summaryrefslogtreecommitdiff
path: root/git-checkout.sh
diff options
context:
space:
mode:
authorNicolas Pitre <nico@cam.org>2007-01-26 16:50:06 (GMT)
committerJunio C Hamano <junkio@cox.net>2007-01-27 06:38:00 (GMT)
commiteb3204dfbb71626f83a95d2ab24569226a39c601 (patch)
tree29d65823a341fcc98be6974e37d3dccce34179e0 /git-checkout.sh
parentd848804a895254583095b5c23ebb5d5f5a8891a3 (diff)
downloadgit-eb3204dfbb71626f83a95d2ab24569226a39c601.zip
git-eb3204dfbb71626f83a95d2ab24569226a39c601.tar.gz
git-eb3204dfbb71626f83a95d2ab24569226a39c601.tar.bz2
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>
Diffstat (limited to 'git-checkout.sh')
-rwxr-xr-xgit-checkout.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/git-checkout.sh b/git-checkout.sh
index c52f352..8500f51 100755
--- a/git-checkout.sh
+++ b/git-checkout.sh
@@ -156,9 +156,9 @@ then
if test -n "$oldbranch"
then
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
-associate a new branch with the wanted checkout. Example:
- git checkout -b <new_branch_name> $arg"
+If you meant to create a new branch from this checkout, you may still do
+so (now or later) by using -b with the checkout command again. Example:
+ git checkout -b <new_branch_name>"
fi
elif test -z "$oldbranch" && test -n "$branch"
then