Tim
Tim

Reputation: 99596

warning: refname 'xxx' is ambiguous

I wonder why I get the warning of refname is ambiguous?

Does it mean that there are no more than two branches whose names start with the string? But there is no here.

Thanks.

$ git checkout  B03799
warning: refname 'B03799' is ambiguous.
Switched to branch 'B03799'

$ git branch -l
  B03318
  B03318new
  B03318newnew
  B03318newnewQa
  B03336
  B03701
* B03799
  master
  qa
  staging

Upvotes: 3

Views: 7099

Answers (1)

1615903
1615903

Reputation: 34879

You have something in your repo that is also named B03799. Most likely a tag (use git tag to list tags), branch (see git branch -a to include remote tracking branches), or a commit whose SHA begins with b03799 (use i.e. this solution to verify). Git has to guess which one you want, but it also gives you a warning so that you know it might have guessed wrong.

You may want to change your branch naming convention so that they don't collide with the hashes, i.e. including at least one character other than 0-9 and a-f.

Upvotes: 7

Related Questions