diff --git a/homeConfig/dotfiles/bash/bashrc b/homeConfig/dotfiles/bash/bashrc index 7035b1c..fcc9727 100644 --- a/homeConfig/dotfiles/bash/bashrc +++ b/homeConfig/dotfiles/bash/bashrc @@ -87,6 +87,17 @@ fi # Custom Functions ## +# CD to Git root +function cdg() { + local root + root=$(git rev-parse --show-toplevel 2> /dev/null) + if [[ -n $root ]]; then + cd $root + else + echo "Not a git repo" + fi +} + # penpot {run|stop|update|help} alias function function penpot() { case "$1" in