-
-
Save sjl/383880 to your computer and use it in GitHub Desktop.
A function to cd to the root of the current Mercurial repository.
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
#!/usr/bin/env bash | |
# cd to the root of the current Mercurial repo | |
# | |
# usage: | |
# Add the following function to your `.bashrc` or `.bash_profile` file, | |
# or save it somewhere (i.e. `~/.cdg.sh`) and source it in `.bashrc` | |
cdh () { | |
hg root >/dev/null && cd "`hg root`" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment