How can one get log listing combined with the differences in each commit
ie:
commit1
Author
Date
Commit message
changes between commit1 and commit2
commit2
Author
Date
Commit message
changes between commit2 and commit3
...
Usinggit log /some/file
Gives a listing of the commits that changed some/file
ie:
commit1
Author
Date
Commit message
commit2
Author
Date
Commit message
...
However, the changes in each commit doesn't get displayed
Usinggit diff hash1..hash2 /some/file
Gives the changes in /some/file between those two commits.
But only between those 2 commits, not through all the commits that changed /some/file
The git diff command returns a list of all the changes in all the files between our last commit and our current repository. If you want to retrieve the changes made to a specific file in a repository, you can specify that file as a third parameter.
Regular git log -p -- A will show all commits that touch file A, and for those commits, it'll show the diffs to A. With --full-diff , it'll show the same commits, but for each commit it'll show the diff of all files changed in that commit. In this case, commit C's diff will show diffs for files A and B.
To see the changes between two commits, you can use git diff ID1.. ID2 , where ID1 and ID2 identify the two commits you're interested in, and the connector .. is a pair of dots. For example, git diff abc123.. def456 shows the differences between the commits abc123 and def456 , while git diff HEAD~1..
According to https://git-scm.com/docs/git-log you can use
git log -p pathto show commits that touch the specified paths, and diffs about the same specified paths.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With