Sometimes you may want a better way to inspect/review Git diffs than what GitX and other tools provide (which is basically a glorified pretty printed linear view of diff hunks).
If you're on a Mac, try "gdiff" shell script. It's a wrapper that launches OS X FileMerge application to inspect diffs.
Just place gdiff
somewhere in your PATH, chmod +x
it too.
You should invoke gdiff
just like git diff
from inside a repo directory.
Here are some things you can do with it:
- see the changes staged for commit:
gdiff --cached
- compare two versions of the source tree:
gdiff branch1 branch2
So basically it either accepts one argument (--cached
) or two arguments (which both are whatever Git considers as names of commits, e.g. commit SHA1-s, branch names, tag names, &c.)
Here's another example. Say you want to see what's new in master:
git fetch
gdiff master origin/master