pjf said:

pjf

Dear lazyweb: Is there a way to ask #git "show me a diff of unpushed changes?"

1 year, 7 months ago.

10 comments so far

  • dryfter

    Would something like diff origin work?

    1 year, 7 months ago by dryfter

  • pjf

    "git diff -- origin" looks like it might. Testing now. ;)

    1 year, 7 months ago by pjf

  • pjf

    Or perhaps not.

    I feel that 'git diff origin' should work, though. (It doesn't.)

    1 year, 7 months ago by pjf

  • dryfter

    how about git diff HEAD origin/HEAD

    1 year, 7 months ago by dryfter

  • pjf

    $ 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

  • silarsis

    surely you're just trying to get a diff between two versions, yes?

    1 year, 7 months ago by silarsis

  • 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

  • pjf

    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

  • dryfter

    On a quick test, "git diff HEAD origin/HEAD" does do what I want!

    1 year, 7 months ago by dryfter

  • pjf

    Hmm, perhaps its time for me to upgrade my version of git. Thanks @dryfter.

    1 year, 7 months ago by pjf

Sign in to add a comment