git diff with color words

I had these files with very very long lines of text on each line. It was paragraphs worth of words but not word wrapped. These files were stored in a git repository. Now and then, someone would change a word. Diff with line based output was difficult to find what actually changed.

I figured there must be a way to see just the words. A little searching around the docs and I found it.

  1.  
  2. > git diff --word-diff=color
  3.  

Perfect. I still got ling scrolling lines though. You can override that with your $GIT_PAGER variable or I just piped the output manually for a one time fix:

  1.  
  2. > git diff --word-diff=color | less -r
  3.  

Much easier to see the changes!

  1. No Comments



css.php