最佳答案
我过去经常使用 git diff origin
。
在一个不同的环境中它不工作。我不知道为什么。
user@host> git diff origin
fatal: ambiguous argument 'origin': unknown revision or path
not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
现况:
user@host> git status
On branch master
nothing to commit, working directory clean
遥控器:
user@host> git remote -v
origin https://example.com/repos/djangotools (fetch)
origin https://example.com/repos/djangotools (push)
版本:
user@host> git --version
git version 2.7.4
使用“ git 版本1.8.1.4”git diff origin
工作。
顺便说一句
BTW2,我认为“/主”是多余的。合理的默认设置是将本地分支与远程站点上的相同分支进行比较。