Tuesday, December 21, 2010

Easily View Logs, Changesets, and Authors in Git, Mercurial, and Subversion from Terminal.app in OS X

I like doing most of my SCM/VCS work in Terminal.app, but when I want to look at logs and the diffs in their changesets for commits, I like a UI.

GitX is great at this. If you've installed Git or have it already, install GitX, start it, and in the menu do "GitX -> Enable Terminal Usage". Restart Terminal.app, browse to a Git repository, and type the following to see the log:

gitx

Subversion was a little trickier. Assuming you've installed Subversion or have it already, install SvnX. Start the application once and it will put the svnx shell script into your ~/bin/svnx. Assuming you don't have ~/bin/ on path, you can add the following to your ~/bash_profile:

alias svnx='~/bin/svnx wc . && ~/bin/svnx log .'

After restarting Terminal.app, browse to a checked-out subversion repository and just type the following to see a log:

svnx

Mercurial is a little tricky, but mostly because the tool I use is called Murky, not hgx, as you might think. Hgx is easier to remember, that is what I call my alias. Assuming you've installed subversion or have it already, install Murky. Then, add the following to your ~/bash_profile:

alias hgx='open -a Murky .'

After restarting Terminal.app, browse to a checked-out Mercurial repository and type the following to see its log:

hgx
(Thanks to Jens Alfke for the Mercurial command-line solution.)

No comments: