Differences between two versions of the same file in nonadjacent commits in git
Let’s say I have a repository with some commits:
latest-commit before-latest-commit ... some-old-commit
Let’s say it has a file called
Let’s say it looks like this across the various commits:
a=1; b=2; c=3;
Can I somehow view the differences between the
some-old-commit versions of
1.file (preferably on github) and have the line
c=3; marked as new, while what went on with b would be left out (as it’s irrelevant).
This seems like something basic, but I wasn’t able to achieve the desired result.
One Solution collect form web for “Differences between two versions of the same file in nonadjacent commits in git”
git diff some-old-commit..latest-commit -- 1.file
You’d not be able to run this on github so first fetch from github in your local repository.