Created
January 30, 2016 20:52
-
-
Save t2b/0d8db8a4cd4dc0cd32d2 to your computer and use it in GitHub Desktop.
cd into git root directory
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
git-root () { | |
if [[ $(git rev-parse --is-inside-work-tree 2>&1) = "true" ]] | |
then | |
cd $(git rev-parse --show-toplevel) | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment