I used git diff origin
often in the past.
In a different environment it does not work. I have no clue why.
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>...]'
Status:
user@host> git status
On branch master
nothing to commit, working directory clean
Remotes:
user@host> git remote -v
origin https://example.com/repos/djangotools (fetch)
origin https://example.com/repos/djangotools (push)
Version:
user@host> git --version
git version 2.7.4
With "git version 1.8.1.4" git diff origin
works.
BTW I see the same err msg if I use "git diff origin/master"
BTW2, I think the "/master" is redundant. The sane default is to compare the local branch with the same branch on the remote site.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…