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

Re: Ambiguous ref names

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 20, 2009, 10:26 UTC
Message-ID
<7vzl6h3319.fsf@alter.siamese.dyndns.org>
In-Reply-To
<5195c8760911200218v5b75d690hbaaf00b44c8df6af@mail.gmail.com>
Jeenu V <jeenuv@gmail.com> writes:
> If I've two branches a.b.c and a.b.c.d, why does 'git checkout'
> complains about ambiguous ref names?
Because it doesn't???
    : demo; git init
    Initialized empty Git repository in /var/tmp/gomi/twelve/.git/
    : demo/master; >f
    : demo/master; git add f
    : demo/master; git commit -a -m 'initial'
    [master (root-commit) cb1d5f2] initial
     0 files changed, 0 insertions(+), 0 deletions(-)
     create mode 100644 f
    : demo/master; git branch a.b.c
    : demo/master; git branch a.b.c.d
    : demo/master; git checkout a.b.c
    Switched to branch 'a.b.c'

It could be that you have a tag and a branch that are both named a.b.c, though.

Previous: Jeenu VNext: Jeenu V
Message 2 of 6 in “Ambiguous ref names”
  1. Jeenu VNov 20, 2009
  2. Junio C HamanoNov 20, 2009
  3. Jeenu VNov 20, 2009
  4. Junio C HamanoNov 20, 2009
  5. Jeenu VNov 20, 2009
  6. Jeenu VDec 11, 2009

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.