Check gh command exists before setting git gh alias

This commit is contained in:
Jeremy Mathevet
2020-04-09 11:06:24 +08:00
parent 9ef0b33641
commit f0af4fd601

View File

@@ -103,7 +103,11 @@ alias gsw="git switch"
alias gswm="git switch master"
alias gswc="git switch --create"
alias gswt="git switch --track"
alias gh='cd "$(git rev-parse --show-toplevel)"'
# Git home
alias ghm='cd "$(git rev-parse --show-toplevel)"'
if ! _command_exists gh; then
alias gh='cd "$(git rev-parse --show-toplevel)"'
fi
# Show untracked files
alias gu='git ls-files . --exclude-standard --others'