Add some more options for zsh

This commit is contained in:
2021-04-16 00:06:15 +01:00
parent 17a908604f
commit 3e6f3a1b3e
2 changed files with 25 additions and 1 deletions

View File

@@ -46,6 +46,19 @@ alias \
enp="enpasscli -vault="$HOME/Documents/Enpass/Vaults/Primary" -sort show" \
dgit="git --git-dir ~/.config/dotfiles/.git --work-tree=$HOME"
# Check if main exists and use instead of master
function git_main_branch() {
command git rev-parse --git-dir &>/dev/null || return
local branch
for branch in main trunk; do
if command git show-ref -q --verify refs/heads/$branch; then
echo $branch
return
fi
done
echo master
}
# Git aliases
alias \
g="git" \