Add some more options for zsh
This commit is contained in:
@@ -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" \
|
||||
|
||||
Reference in New Issue
Block a user