Skip to content

Commit

Permalink
checkout: make the message about the need for a new branch a bit clearer
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Nicolas Pitre authored and Junio C Hamano committed Dec 23, 2006
1 parent a979d12 commit 0a57617
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions git-checkout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,11 @@ fi

[ -z "$branch$newbranch" ] &&
[ "$new" != "$old" ] &&
die "git checkout: to checkout the requested commit you need to specify
a name for a new branch which is created and switched to"
die "git checkout: provided reference cannot be checked out directly
You need -b to associate a new branch with the wanted checkout. Example:
git checkout -b <new_branch_name> $arg
"

if [ "X$old" = X ]
then
Expand Down

0 comments on commit 0a57617

Please sign in to comment.