Created
January 31, 2009 21:24
-
-
Save pete/55665 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| cdgit() { | |
| pushd . | |
| while [ ! -d .git ]; do | |
| cd .. | |
| if [ $(pwd) = '/' ]; then | |
| echo 'Not in a git repo.' >&1 | |
| popd | |
| return | |
| fi | |
| done | |
| popd | |
| cd - | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment