@matheusbsbs / matheus-bagliano / commits / eb3204dfbb
Fork 0

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>

Nicolas Pitre committed Jan 26, 2007 at 11:50 UTC eb3204dfbb71626f83a95d2ab24569226a39c601
1 file changed +3 -3
git-checkout.sh
+3 -3
@@ -156,9 +156,9 @@ then
156 if test -n "$oldbranch"
157 then
158 detach_warn="warning: you are not on ANY branch anymore.
159 -If you meant to create a new branch from the commit, you need -b to
160 -associate a new branch with the wanted checkout. Example:
161 - git checkout -b <new_branch_name> $arg"
159 +If you meant to create a new branch from this checkout, you may still do
160 +so (now or later) by using -b with the checkout command again. Example:
161 + git checkout -b <new_branch_name>"
162 fi
163 elif test -z "$oldbranch" && test -n "$branch"
164 then