Git warning: refname 'xxx' is ambiguous

I have two branches "master" and "develop", I create a new branch from the master, which is "hotfix-1", and then I merge the "fix-1" back to master with;

git checkout master git merge --no-ff hotfix-1 

Created a tag for this point;

 git tag -a hotfix-1 -m "" 

and then I switched back to develop a branch from the wizard and merge Patch-1 with:

 git checkout develop git merge --no-ff hotfix-1 

after merging "hotfix-1" for development "I get a message ": refname "hotfix-1" is an ambiguous " message and successfully merging my changes for development > too .. should I worry about anything?

Edit

 git show-ref --heads --tags d97bfc563749918799d4659c43f7bffd29cf4d60 refs/heads/develop 594ea85c94f8321d372779ed3dbd5df07bdb059b refs/heads/master ffc897f8ab19510d5ff4c67969d0f0cb97d1c4f3 refs/tags/beta-1.0 490a8c80ecec70fd2268aa0c2ad7a9beb6bf491c refs/tags/beta-1.1 644adadb43744ad1d2e0f13fc37abb6906520f8f refs/tags/hotfix-1.0.1 4c49e8d9ddc8d601ed794f307e1c29acfc84b31b refs/tags/release-1.0 
+8
git git-merge
source share
2 answers

From your original question, it looks like you have a tag and branch named hotfix-1 . Of course, their actual names are refs/tags/hotfix-1 and refs/heads/hotfix-1 respectively, but Git allows you to use a shorthand notation, which is ambiguous in this case, since Git allows you to use any commits in the git merge statement. In fact, when I tested this script, Git merged the tag, not the branch.

When viewing git show-ref --heads --tags output, git show-ref --heads --tags is unclear, however, since there is only a tag named hotfix-1.0.1 and not a single branch with the same name. It looks like you may have changed the situation later.

+11
source share

Here is an example where what Joseph assumed about what happened really happened to us.

git merge BranchyBranch_r2.1 warning: refname 'BranchyBranch_r2.1' is ambiguous.

In fact, there is both a tag and a branch with the same name (BranchyBranch_r2.1), and in addition, someone tried to alleviate the problem by superimposing a tag on it that duplicated the branch.

git show-ref --heads --tags ac729d902578378557f9f20dbd415c5748a23230 refs/heads/BranchyBranch_r2.1 9f3d242e03837fd33f8355005e9edbee89367bef refs/heads/develop 5995987876e6a2315544bd774b546ed561f78a53 refs/heads/master df26c94be018268e2897807c0750b5c66150750b refs/tags/BranchyBranch_r2.1 df26c94be018268e2897807c0750b5c66150750b refs/tags/BranchyBranch_r2.1Tag

If you reference the branch with your full name, you can continue.

git merge refs/heads/BranchyBranch_r2.1

+1
source share

All Articles