fix suggested branch creation command when detaching head
Doing: $ git checkout HEAD^ Generates the following message: |warning: you are not on ANY branch anymore. |If you meant to create a new branch from the commit, you need -b to |associate a new branch with the wanted checkout. Example: | git checkout -b <new_branch_name> HEAD^ Of course if the user does as told at this point the created branch won't be located at the expected commit. Reword this message a bit to avoid such confusion. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:

committed by
Junio C Hamano

parent
d848804a89
commit
eb3204dfbb
@ -156,9 +156,9 @@ then
|
|||||||
if test -n "$oldbranch"
|
if test -n "$oldbranch"
|
||||||
then
|
then
|
||||||
detach_warn="warning: you are not on ANY branch anymore.
|
detach_warn="warning: you are not on ANY branch anymore.
|
||||||
If you meant to create a new branch from the commit, you need -b to
|
If you meant to create a new branch from this checkout, you may still do
|
||||||
associate a new branch with the wanted checkout. Example:
|
so (now or later) by using -b with the checkout command again. Example:
|
||||||
git checkout -b <new_branch_name> $arg"
|
git checkout -b <new_branch_name>"
|
||||||
fi
|
fi
|
||||||
elif test -z "$oldbranch" && test -n "$branch"
|
elif test -z "$oldbranch" && test -n "$branch"
|
||||||
then
|
then
|
||||||
|
Reference in New Issue
Block a user