git refname 'origin/master' is ambiguous

前端 未结 4 2151
遥遥无期
遥遥无期 2020-12-02 06:46

I have a git repository that is tracking several remote branches:

$ git branch -a
* master
  remotes/git-svn
  remotes/origin/master
  remotes/trunk
<         


        
4条回答
  •  隐瞒了意图╮
    2020-12-02 07:05

    You probably accidentally created a local ref called 'origin/master'

    for instance, if you did this

    git branch origin/master
    

    It would lead to this problem. This one looks suspect "refs/origin/master". "refs/heads/master" is your local master, "refs/remotes/origin/master" is your remote branch reference, and "refs/origin/master" is probably a mistake that is screwing you up.

    You just need to delete that reference (git update-ref -d ) and things will start working again.

提交回复
热议问题