$ git diff HEAD origin/HEAD
fatal: ambiguous argument 'origin/HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
in bzr terminology, where the branch originated from is irrelevant - you ask it for a patch from branch a to branch b. You can also ask for a patch between branches b and c. One of those might be the original "trunk" or "HEAD", but you neither know nor care particularly, afaics
I am indeed trying to get a diff between two versions.
I'm very happy with asking "show me the differences between the last version I pushed and now". The trouble is finding the terminology for "the last version I pushed". "origin" feels like it should work (since I can push and pull to it) but it doesn't work for diffs.
At the moment not knowing isn't a big deal. If it starts to become so, I have a few git developers I can lean on for assistance. ;)
10 comments so far
Would something like diff origin work?
1 year, 7 months ago by dryfter
"git diff -- origin" looks like it might. Testing now. ;)
1 year, 7 months ago by pjf
Or perhaps not.
I feel that 'git diff origin' should work, though. (It doesn't.)
1 year, 7 months ago by pjf
how about git diff HEAD origin/HEAD
1 year, 7 months ago by dryfter
$ git diff HEAD origin/HEAD fatal: ambiguous argument 'origin/HEAD': unknown revision or path not in the working tree. Use '--' to separate paths from revisions
'git diff origin' provides a similar error.
1 year, 7 months ago by pjf
surely you're just trying to get a diff between two versions, yes?
1 year, 7 months ago by silarsis
in bzr terminology, where the branch originated from is irrelevant - you ask it for a patch from branch a to branch b. You can also ask for a patch between branches b and c. One of those might be the original "trunk" or "HEAD", but you neither know nor care particularly, afaics
1 year, 7 months ago by silarsis
I am indeed trying to get a diff between two versions.
I'm very happy with asking "show me the differences between the last version I pushed and now". The trouble is finding the terminology for "the last version I pushed". "origin" feels like it should work (since I can push and pull to it) but it doesn't work for diffs.
At the moment not knowing isn't a big deal. If it starts to become so, I have a few git developers I can lean on for assistance. ;)
1 year, 7 months ago by pjf
On a quick test, "git diff HEAD origin/HEAD" does do what I want!
1 year, 7 months ago by dryfter
Hmm, perhaps its time for me to upgrade my version of git. Thanks @dryfter.
1 year, 7 months ago by pjf