Why does git branch -t fail with “Not tracking: ambiguous information”?

后端 未结 5 1916
面向向阳花
面向向阳花 2021-02-03 21:10

When I try to create a new branch tracking a remote branch, I get this:

$ git branch -t test origin/foo
error: Not tracking: ambiguous information for ref refs/r         


        
5条回答
  •  南旧
    南旧 (楼主)
    2021-02-03 21:27

    I saw this also when I had two remote repo's with the same (default) fetch pattern (fetch = +refs/heads/*:refs/remotes/origin/*) and the same branches.

    I still haven't worked out how to fix it properly, since I want to continue to push/pull to both repo's, but manually adding the info to the project's .git/config works, e.g.:

    [branch "mybranch"]
      remote = origin
      merge = refs/heads/mybranch
    

提交回复
热议问题