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

[BUG] "git checkout -b" erronously thinks a branch already exists

From
Stefano Lattarini <stefano.lattarini@gmail.com>
Date
Jun 5, 2011, 11:05 UTC
Message-ID
<201106051305.13723.stefano.lattarini@gmail.com>

First of all, sorry if this is the wrong address for bug reporting, but I couldn't find any `git-bug' mailing list, nor a bug tracker.

Apparently, "git checkout -b NAME" fails if NAME contains the output from "git-describe". This happens for me both with git 1.7.2.3 installed from debian packages, and with the latest developement version of git.

The attached script demonstrate the failures; here is what it outputs on my system:

 $ sh bug.sh 
 + GIT=git
 + mkdir foo.dir
 + cd foo.dir
 + git init
 Initialized empty Git repository in /tmp/foo.dir/.git/
 + :
 + git add f1
 + git commit -m none
 [master (root-commit) 9b06795] none
  0 files changed, 0 insertions(+), 0 deletions(-)
  create mode 100644 f1
 + git tag -a -m 'first commit' v0
 + :
 + git add f2
 + git commit -m none
 [master ef5d975] none
  0 files changed, 0 insertions(+), 0 deletions(-)
  create mode 100644 f2
 ++ git describe
 + desc=v0-1-gef5d975
 + git checkout -b fix-v0-1-gef5d975
 fatal: git checkout: branch fix-v0-1-gef5d975 already exists

If you need more details, or if you can explain why this is an user error, please keep me in CC:, as I'm not subscribed to this list. In case it is indeed an user error, sorry for the noise.

Regards,
  Stefano
Next: Junio C Hamano
Message 1 of 5 in “[BUG] "git checkout -b" erronously thinks a branch already exists”
  1. Stefano LattariniJun 5, 2011
  2. Re* [BUG] "git checkout -b" erronously thinks a branch already existsJunio C Hamano, Jun 6, 2011
  3. Junio C HamanoJun 6, 2011
  4. Stefano LattariniJun 6, 2011
  5. Jeff KingJun 6, 2011

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.