Skip to content

Instantly share code, notes, and snippets.

@blackymetal
Last active December 21, 2015 23:28
Show Gist options
  • Save blackymetal/6382246 to your computer and use it in GitHub Desktop.
Save blackymetal/6382246 to your computer and use it in GitHub Desktop.
Git diff one file from two different commits
$ git diff $start_commit..$end_commit -- path/to/file
For instance, to see the difference for a file "main.c" between now and two commits back, here are two equivalent commands:
$ git diff HEAD^^ HEAD main.c
$ git diff HEAD^^..HEAD -- main.c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment