Created
May 7, 2009 06:18
-
-
Save 4rc0s/107945 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function gr { | |
## If the current working directory is inside of | |
## a git repository, this function will change | |
## it to the git root (ie, the directory that | |
## contains the .git/ directory), and then print | |
## the new directory. | |
git branch > /dev/null 2>&1 || return 1 | |
cd "$(git rev-parse --show-cdup)". | |
pwd | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment