Git trick: Colored Web Page with Changes Highlighted

With git, you can create a web page with changed words highlighted. Red==removed, green==added.

When you have found a colleague, friend or a supervisor who can provide useful feedback, great!

When you make the changes and ask for more feedback, you don’t want to make your friend read the 50 pages again. And not everyone uses git (yet). Just create an HTML page with changes highlighted.

Find the Revision You Like

$ git log

or

 $ git whatchanged

Notice the revision number.

Show the Differences

$ git diff --unified=999999 --color-words 7b73574c67401e2fe603c35a7656bd1acf2af00d terosdoc.md

Save as Colored HTML

$ git diff --unified=999999 --color-words 7b73574c67401e2fe603c35a7656bd1acf2af00d terosdoc.md|ansi2html >diff.html

Now you have an HTML document to send to your friend, with changes highlighted.

Posted in Uncategorized | Tagged , , , , , , | Leave a comment

Leave a Reply

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

*

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

  • Picks

  • Boxing Clock for AndroidOcton8 Diving T-ShirtsShaking Tower Panda Android GameLearn Chinese with Android
  • Student projects