What is a good way to browse git commits locally with syntax highlighting?
Basically, I want to do "git diff" between a particular commit a its previous commit, but with syntax highlighting supported.
What is a good way to browse git commits locally with syntax highlighting?
Basically, I want to do "git diff" between a particular commit a its previous commit, but with syntax highlighting supported.
All you need is a pager that supports syntax highlighting. Vim could be used for this:
GIT_PAGER="vim -" git diff --no-color ...
--no-color turns off git-diff's own colouring, which would otherwise just show up as clutter (unless you have vim set up to deal with ANSI escape sequences).
The result isn't necessarily perfect, because the output of git-diff obviously isn't valid code in whatever programming language you're using, but it's close and easy.
There are many options to accomplish this depending on your system (PC, Mac, Linux) but if you're looking for a gui:
Mac: GitX
PC: Git Extensions