visionmedia/git-extras — Issue #54: Feature: git root
Author: MatthewMueller
Created: 2011-10-26 03:43:34+00:00
State: open

Found this today, thought it might be a nice addition to the library.

Wherever you are in the repository `git root` will take you to the root directory (where .git is stored).

I'm horrible with bash scripting, so maybe someone else can whip up a script, but here's an alias.
```
alias gr='[ ! -z `git rev-parse --show-cdup` ] && cd `git rev-parse --show-cdup || pwd`'
```

Lifted this from this article: http://www.clientcide.com/best-practices/j-or-z-for-command-line-awesomeness/