Change Directory to Your Git Root
Add this to your ~/.zshrc
or whatever:
alias cdg='cd $(git rev-parse --show-toplevel)'
Then run source ~/.zshrc
and you'll be able to cd to the root of your current git repo with cdg
.
Written by Reid Ransom
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#