You can see the same warning in this blog post
(master)jj@im-jj:~/demo$ git checkout -b rc-1.0
Switched to a new branch 'rc-1.0'
(rc-1.0)jj@im-jj:~/demo$ git push origin rc-1.0
Total 0 (delta 0), reused 0 (delta 0)
To my-server:/git/demo.git
* [new branch] rc-1.0 -> rc-1.0
(rc-1.0)jj@im-jj:~/demo$ git remote show origin
* remote origin
URL: my-server:/git/demo.git
HEAD branch (remote HEAD is ambiguous, may be one of the following):
master
rc-1.0
Remote branches:
master tracked
rc-1.0 tracked
Local branch configured for 'git pull':
master merges with remote master
Local refs configured for 'git push':
master pushes to master (up to date)
rc-1.0 pushes to rc-1.0 (up to date)
That (pushing a new current branch) will introduce a new HEAD reference to the remote repo.
If you look at the Git sources for this warning message, it tries to get the remote HEAD names through get_head_names()
which calls :
matches = guess_remote_head(find_ref_by_name(remote_refs, "HEAD"),
+ fetch_map, 1);
As described in this patch:
Determining HEAD is ambiguous since it is done by comparing SHA1s.
(see the code here)
In the case of multiple matches we return refs/heads/master if it matches, else we return the first match we encounter. builtin-remote
needs all matches returned to it, so add a flag for it to request such.