I know that git diff --word-diff=color
shows a word diff between the working tree and HEAD, but is there a way to get the same kind of output with git log
?
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.
You can run the git diff HEAD command to compare the both staged and unstaged changes with your last commit. You can also run the git diff <branch_name1> <branch_name2> command to compare the changes from the first branch with changes from the second branch. Order does matter when you're comparing branches.
Diffing is a function that takes two input data sets and outputs the changes between them. git diff is a multi-use Git command that when executed runs a diff function on Git data sources. These data sources can be commits, branches, files and more.
git log by default shows the entire ancestry in order by birthdate (where timestamp weirdities don't make that contradict ancestry). Try it with git log --oneline --graph --decorate --first-parent . ^ or ^1 means the first parent.
What about --color-words
? Additionally you somehow have to activate the diff.
git log --color-words -p
shows me kind of a colored diff.
OK I think I got it working with
git log -m -p --word-diff=plain
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