Skip to content

Commit bf08aba

Browse files
committed
branch: document -f and linked worktree behaviour
"git branch -f name start" forces to recreate the named branch, but the forcing does not defeat the "do not touch a branch that is checked out elsewhere" safety valve. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 37537d6 commit bf08aba

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Documentation/git-branch.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ OPTIONS
123123
points to a valid commit. In combination with
124124
`-m` (or `--move`), allow renaming the branch even if the new
125125
branch name already exists, the same applies for `-c` (or `--copy`).
126+
+
127+
Note that 'git branch -f <branchname> [<start-point>]', even with '-f',
128+
refuses to change an existing branch `<branchname>` that is checked out
129+
in another worktree linked to the same repository.
126130

127131
-m::
128132
--move::

0 commit comments

Comments
 (0)