Last active
December 21, 2015 23:28
-
-
Save blackymetal/6382246 to your computer and use it in GitHub Desktop.
Git diff one file from two different commits
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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