21st April 2022
Computer Science⚑
GNULinux⚑
Git⚑
-
New: Merge conflict style.
Take the pain out of git conflict resolution: use diff3
git config --global merge.conflictstyle diff3After running this command to turn on diff3, each new conflict will have a 3rd section, the merged common ancestor.
<<<<<<< HEAD GreenMessage.send(include_signature: true) ||||||| merged common ancestor BlueMessage.send(include_signature: true) ======= BlueMessage.send(include_signature: false) >>>>>>> merged-branch -
New: View file evolution.
You can use
git log -Lto view the evolution of a range of lines. Example:git log -L 15,23:filename.txtmeans trace the evolution of lines
15to23in the file namedfilename.txt. -
New: Compare file accross references.
To compare a file accross references (branches, tags, commits...) do:
git diff <reference1> <reference2> -- <file>