How can I get the most bang for my buck with the "diff" command?
In no particular sequence:
meld
is a very nice diff program which does very nice diffs and three-way merges.git config --global merge.conflictstyle diff3
gets you three-way merge output for use with tools likemeld
.wdiff
does word diffs, very nice if colored:wdiff -w "$(tput bold;tput setaf 1)" -x "$(tput sgr0)" -y "$(tput bold;tput setaf 2)" -z "$(tput sgr0)" ...
- To minimize cruft in the
diff
output, I usually use the--ignore-all-space
(-w
) option diff-ignore-moved-lines
* does what it says on the label.difff
* can be used to diff only lines which match in given fields.
* Disclaimer: I'm the author, and developed these to help with CLI and GUI diffing and merging.
I've found vimdiff
to be very useful.
To get coloring in the diff you should look at http://colordiff.sourceforge.net/ . This is just a wrapper around diff and, as such, all the command options still work.
In case you have ubuntu just write:
# sudo apt-get install colordiff
Running the risk of not meeting your use case, git
is a very nice VCS that integrates well with many diffing and merging tools (both command line and GUI ones). Give it a try if it is an option.