Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
General Tips¶
If 2 files are formatted differently, you can first format them and then check the differences between them. An extreme way is to get rid of all white spaces in the 2 files and then compare them.
sed -i 's/ //g' file_1 file_2
Command-line Tools¶
git-diff¶
git diff is a generally useful command.
It can not only show you the changes of files in side a Git repository
but can also be used to compare files/directories outside of a Git repository.
Show differences between 2 files. The option
--no-indexcan be omitted if at least one of the two files is outside a Git repository. Output ofgit diffis colorized.git diff --no-index file_1 file_2Show differences between 2 directories, which is similar to that of showing differences between 2 files.
git diff --no-index dir_1 dir_2
colordiff/diff¶
It is suggested that you use colordiff instead of diff
as colordiff colorizes the output of diff.
However,
both colordiff and diff can be replaced by git diff as shown above.
vimdiff¶
All of git diff, colordiff and diff show line-leve changes.
vimdiff is great command-line tool that is able to show differences inside lines.
Online Tools¶
text-compare¶
text-compare is a good one.
diffnow¶
References¶
https://
https://
https://
https://
https://