Merge branch 'jc/doc-branch-update-checked-out-branch' into maint-2.39

Document that "branch -f <branch>" disables only the safety to
avoid recreating an existing branch.

* jc/doc-branch-update-checked-out-branch:
  branch: document `-f` and linked worktree behaviour
This commit is contained in:
Junio C Hamano 2023-02-14 14:15:52 -08:00
commit 26fc326044

View File

@ -123,6 +123,10 @@ OPTIONS
points to a valid commit. In combination with points to a valid commit. In combination with
`-m` (or `--move`), allow renaming the branch even if the new `-m` (or `--move`), allow renaming the branch even if the new
branch name already exists, the same applies for `-c` (or `--copy`). 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:: -m::
--move:: --move::