Guest User

Untitled

a guest
May 23rd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. reporoot () {
  2. if git rev-parse --is-inside-git-tree >/dev/null 2>&1; then
  3. git rev-parse --git-dir | sed -e 's/\/.git$//'
  4. elif hg root 2>/dev/null; then
  5. :
  6. else
  7. echo $PWD
  8. fi
  9. }
  10. alias cdroot='cd $(reporoot)'
Add Comment
Please, Sign In to add comment