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

If for some reason you are unable to install a diffing tool like p4merge to beautifully see the diffs (for example if your code resides in an environment where you dont have a windowing environemt, e.g. in a remote host to which you only have shell access), you can still make viewing diffs a little more easy to decipher by simply running the following command.

git diff --word-diff

This way, git will not just show you which lines were deleted or added, it will also try to determine which lines were ‘changed’ making things much more esier to figure out.

Ryan Sukale

Ryan is just a regular guy next door trying to manage his life and finances.

You may also like...

Leave a Reply

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