]> git.ipfire.org Git - thirdparty/git.git/commitdiff
branch: document `-f` and linked worktree behaviour
authorJunio C Hamano <gitster@pobox.com>
Thu, 19 Jan 2023 07:23:46 +0000 (23:23 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 19 Jan 2023 07:48:11 +0000 (23:48 -0800)
"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 <gitster@pobox.com>
Documentation/git-branch.txt

index 12c5f84e3bef5c83c80edec9850315dd334beffa..2aaf13b45d329adf1f18dc250191809f7ce64443 100644 (file)
@@ -123,6 +123,10 @@ OPTIONS
        points to a valid commit. In combination with
        `-m` (or `--move`), allow renaming the branch even if the new
        branch name already exists, the same applies for `-c` (or `--copy`).
++
+Note that 'git branch -f <branchname> [<start-point>]', even with '-f',
+refuses to change an existing branch `<branchname>` that is checked out
+in another worktree linked to the same repository.
 
 -m::
 --move::