zsh: Move 'change directory into repo root' logic

Add an alias that switches directories into the repository root, instead
of having the normal `cd` command behave like that.

Sadly this is not possible (AFAIK) with a git alias as that will always
spawn a subshell.
This commit is contained in:
2022-04-23 16:59:44 +02:00
parent e97ade48e2
commit 8cd490ea0a
2 changed files with 10 additions and 20 deletions

View File

@@ -60,6 +60,7 @@ fi
alias ga='git add'
alias gap='git add -p'
alias gc='git commit'
alias gcd='cd "$(git rev-parse --show-toplevel)"'
alias gch='git checkout'
alias gd='git diff'
alias gds='git diff --staged'