2012-05-17 81 views
3

我可以推,拉和上行/主站檢查沒有問題,但我確實收到警告。 上游/主要用於跟蹤對我分叉的原始源代碼(遵循github指令)所做的更改。Pathspec上游/主站模糊不清

E.g.

$ git checkout upstream/master 
warning: refname upstream/master is ambiguous 

$ git branch -a 
* master 
    upstream/master 
    remotes/origin/HEAD -> origin/master 
    remotes/origin/master 
    remotes/upstream/master 

此命令也有不明確的錯誤:

$ git branch 
* master 
    upstream/master 

$ git checkout upstream/master filename.bar 

回答

2

This page提到的通常原因爲這類消息的:

When you try to checkout a local branch, you get a

warning: refname 'branch-name' is ambiguous 

This can happen if you've created a local branch with the same name as a remote tag.
Git should be checking out your local branch, but instead it's trying to checkout the tag, and it gets confused.

In general, when creating tags, be careful not to have names that conflict with existing (local or remote) branches.