Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resolve ambiguity between branch name and commit hash in git?

I have a branch named 0726b and I want to diff my current working copy with that branch. Apparently there is also a commit that has a hash starting with that very sequence, because I get

$ git diff 0726b
warning: refname '0726b' is ambiguous.

How do I tell git that it should take the argument as a branch name?

like image 218
Tobi Avatar asked Jul 26 '18 08:07

Tobi


1 Answers

Try this:

git diff refs/heads/0726b

refs/heads/0726b specifies a branch named 0726b. The file ./git/refs/heads/0726b contains the commit hash that this branch points to.

like image 197
sergej Avatar answered Oct 16 '22 21:10

sergej