Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- reporoot () {
- if git rev-parse --is-inside-git-tree >/dev/null 2>&1; then
- git rev-parse --git-dir | sed -e 's/\/.git$//'
- elif hg root 2>/dev/null; then
- :
- else
- echo $PWD
- fi
- }
- alias cdroot='cd $(reporoot)'
Add Comment
Please, Sign In to add comment