On git, how could i compare the same file between two different commits (not contiguos) on the same branch (master for example)?
Is it possible? (i'm searching for a "Compare" feature like the one in VSS or TFS)
On git, how could i compare the same file between two different commits (not contiguos) on the same branch (master for example)?
Is it possible? (i'm searching for a "Compare" feature like the one in VSS or TFS)
$ 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:
$ git diff HEAD^^..HEAD -- main.c
If you want to see all changes to the file between the two commits on a commit-by-commit basis, you can also do
git log -u $start_commit..$end_commit -- path/to/file
You can also compare two different files in two different revisions, like this:
git diff <revision_1>:<file_1> <revision_2>:<file_2>