git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] make the message about the need for a new branch a bit clearer

From
Nicolas Pitre <nico@cam.org>
Date
Dec 22, 2006, 20:06 UTC
Message-ID
<Pine.LNX.4.64.0612221502360.18171@xanadu.home>
Signed-off-by: Nicolas Pitre <nico@cam.org>
---
diff --git a/git-checkout.sh b/git-checkout.sh
index c877440..923d81c 100755
--- a/git-checkout.sh
+++ b/git-checkout.sh
@@ -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
Message 1 of 1 in “make the message about the need for a new branch a bit clearer”
  1. make the message about the need for a new branch a bit clearerNicolas Pitre, Dec 22, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.