在我的远程存储库上创建了一个新的分支。在我的工作目录(主分支)上的GitBash中,输入git remote update
和git pull
。据我了解git remote update
将更新所有分支机构设置为这里解释追踪远程的: What is the difference between 'git remote update', 'git fetch' and 'git pull'?git分支unkown,但结帐工作
所以,当我键入git diff master newBranch --name-only
我希望看到这是在两个分支不同的文件列表。而是我得到了以下错误消息:
fatal: ambiguous argument 'newBranch': unknown revision or path not in the working tree.
但如果我键入git checkout newBranch
它工作正常,如果我通过键入git checkout master
突然git diff master newBranch --name-only
作品完美地切换回主?
任何人都可以向我解释这种行为吗?