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.
originalone is never expected in anygit diffcommand.git version 1.8.1.4git diff originis short forgit diff master origin/masterif the current branch ismaster. If the current branch has no remote tracking branch, it should not work.originwill typically resolve via step 6, i.e., by resolvingorigin/HEAD. (If some earlier step resolves it first, though, you will get the earlier step's resolution. Iforigin/HEADdoes not exist or is invalid, you will get thefatalyou are seeing.) This pays no attention to the current branch's upstream setting: if you want to diff against that, use@{u}. You might say that Git uses the insane default. :-)