问题描述:

XXX /path (master)

$ git lol -1 2.1.092

warning: refname '2.1.092' is ambiguous. // HERE

* 5c3a09e (tag: release/2.1.092-rc3) A merge commit here

|\

XXX /path (master)

$ git lol -1 refs/heads/2.1.092

* f387ed8 (origin/2.1.092, 2.1.092) Another merge commit here

|\

XXX /path (master)

$ git show-ref | grep 2.1.092

f387ed8d58ffbda85cc52f4828b061980bbb3a7d refs/heads/2.1.092

f387ed8d58ffbda85cc52f4828b061980bbb3a7d refs/remotes/origin/2.1.092

28cc8af084c435cf53076993ab85add9886abb3d refs/tags/release/2.1.092-rc2

576144d52dae89e7f749e8d41801f13844e57d22 refs/tags/release/2.1.092-rc3

XXX /path (master)

$ git here 2.1.092

warning: refname '2.1.092' is ambiguous.

commit 5c3a09e243bee1a3d81fd0a02769972fe3900b6f

Merge: e7c71d7 eded388

Author: XXXX

XXX /path (master)

$ git here 576144d52dae89e7f749e8d41801f13844e57d22

commit 5c3a09e243bee1a3d81fd0a02769972fe3900b6f

Please take a look at the 3rd line. Why is this refname ambiguous? I guess I must have messed up something with the refs.

网友答案:

It seems 2.1.092 is both:

  • the name of a tag referencing the merge commit 5c3a09e
  • the name of a branch (refs/heads/2.1.092, for commit f387ed8d5)

You can rename the tag or rename the branch.

As in "Git: warning: refname 'master' is ambiguous", check if you don't have a .git/2.1.092 file: if it is the case, removes it.

相关阅读:
Top