Better git diff — at the word level — in the terminal

If for some rea­son you are unable to install a diff­ing tool like p4merge to beau­ti­fully see the diffs (for exam­ple if your code resides in an envi­ron­ment where you dont have a win­dow­ing envi­ronemt, e.g. in a remote host to which you only have shell access), you can still make view­ing diffs a lit­tle more easy to deci­pher by sim­ply run­ning the fol­low­ing command.

git diff --word-diff

This way, git will not just show you which lines were deleted or added, it will also try to deter­mine which lines were ‘changed’ mak­ing things much more esier to fig­ure out.


You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *