Skip to content

worktree add: shouldn't dwim if -b or -B is given - #2192

Open
yoichi wants to merge 1 commit into
gitgitgadget:masterfrom
yoichi:worktree-add-should-not-dwim-with-b
Open

worktree add: shouldn't dwim if -b or -B is given#2192
yoichi wants to merge 1 commit into
gitgitgadget:masterfrom
yoichi:worktree-add-should-not-dwim-with-b

Conversation

@yoichi

@yoichi yoichi commented Aug 4, 2026

Copy link
Copy Markdown

CC: Jacob Abel jacobabel@nullpo.dev

'git worktree add <path> <branch>' DWIMs <branch> to a
remote-tracking branch when neither -b, -B, nor --detach
is given.

However, 'git worktree add -b <new-branch> <path> <branch>' can
still DWIM <branch>, causing <new-branch> to be ignored.

This is a regression introduced in v2.42.0
(128e549).

Signed-off-by: Yoichi NAKAYAMA <yoichi.nakayama@gmail.com>
@yoichi
yoichi force-pushed the worktree-add-should-not-dwim-with-b branch from 1cd8461 to 908a32f Compare August 4, 2026 12:46
@yoichi

yoichi commented Aug 4, 2026

Copy link
Copy Markdown
Author

/preview

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant