diff --git a/shrc b/shrc index b16f74e..5a3cc5f 100755 --- a/shrc +++ b/shrc @@ -433,6 +433,15 @@ cd(){ builtin cd "$@" && pwd } +root(){ + if test "`git rev-parse --is-inside-work-tree 2>/dev/null`" = true + then + cd "`git rev-parse --show-toplevel`" + else + cd / + fi +} + # pad alias pad=notepad __safe_alias pad=gedit