git diff of a file between two commits 1

git diff of a file between two commits

$ git diff HEAD^^ HEAD main.c
$ # show diff between HEAD(current commit) and HEAD^^(two commits back) for main.c

Here is what the above code is Doing:
1. git diff: Show changes between commits, commit and working tree, etc
2. HEAD^^: The commit before the current commit
3. HEAD: The current commit
4. main.c: The file to show the diff for

Similar Posts