git warning: refname 'HEAD' is ambiguous. What is the problem?
習慣沉默
習慣沉默 2017-05-02 09:41:09
0
1
1460
git status
git warning: refname 'HEAD' is ambiguous
git warning: refname 'HEAD' is ambiguous
On branch develop
Your branch is up-to-date with 'origin/develop'
nothing to commit, working tree clean

The ref information is as follows

git show-ref
...... refs/heads/HEAD
...... refs/heads/develop
...... refs/heads/master
...... refs/remotes/origin/HEAD
...... refs/remotes/origin/develop
...... refs/remotes/origin/master
...... refs/tags/v1.0
...... refs/tags/v1.1

How to solve it?

習慣沉默
習慣沉默

reply all(1)
给我你的怀抱

This problem is because you have a branch called HEAD 的分支造成的,这个名字你可以看作是一个保留字,它用于标示哪个分支是 当前分支 ,而不应该直接拿来做分支的名字(但是 remote 的 HEAD 分支是 OK 的,比如 origin/HEAD,经常有人把这个 checkout 下来,结果就变成了本地的 HEAD, which is where this problem comes from).

The solution is very simple. Just delete or rename the branch. For example, delete:

git branch -D HEAD

In addition, someone also created a tag using HEAD, which will also cause the same problem, p.s.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template