git-rev-parse(1) 解释了如何将远程的名称用作参考:
<refname>, e.g. master, heads/master, refs/heads/master
A symbolic ref name. E.g. master typically means the commit object
referenced by refs/heads/master. If you happen to have both heads/master and
tags/master, you can explicitly say heads/master to tell Git which one you
mean. When ambiguous, a <refname> is disambiguated by taking the first match
in the following rules:
1. If $GIT_DIR/<refname> exists, that is what you mean (this is usually
useful only for HEAD, FETCH_HEAD, ORIG_HEAD, MERGE_HEAD and
CHERRY_PICK_HEAD);
2. otherwise, refs/<refname> if it exists;
3. otherwise, refs/tags/<refname> if it exists;
4. otherwise, refs/heads/<refname> if it exists;
5. otherwise, refs/remotes/<refname> if it exists;
6. otherwise, refs/remotes/<refname>/HEAD if it exists.
并且 git-remote(1) 解释refs/remotes/<remote>/HEAD
了描述中的内容git remote set-head
:
set-head
Sets or deletes the default branch (i.e. the target of the symbolic-ref
refs/remotes/<name>/HEAD) for the named remote. Having a default branch
for a remote is not required, but allows the name of the remote to be
specified in lieu of a specific branch. For example, if the default
branch for origin is set to master, then origin may be specified wherever
you would normally specify origin/master.
换句话说,它使用远程的默认分支,而您似乎没有。