if [ -z "${BYTELYST_ALIAS_DIR:-}" ]; then
    if [ -n "${BASH_SOURCE[0]:-}" ]; then
        _bytelyst_git_alias_source="${BASH_SOURCE[0]}"
    elif [ -n "${ZSH_VERSION:-}" ]; then
        _bytelyst_git_alias_source="${(%):-%N}"
    else
        _bytelyst_git_alias_source="$0"
    fi

    BYTELYST_ALIAS_DIR="$(cd -- "$(dirname -- "$_bytelyst_git_alias_source")" >/dev/null 2>&1 && pwd -P)"
    unset _bytelyst_git_alias_source
fi

alias oga='${EDITOR:-vim} "$BYTELYST_ALIAS_DIR/_git.alias"'
alias sga='source "$BYTELYST_ALIAS_DIR/_git.alias"'
alias gcl='git checkout -'
alias gcb='git checkout -b'
alias gcm='git checkout main'



#git
alias gs='git status'
alias gdc='git diff --cached'
alias gd='git diff'
alias gr='git reset'
alias ga='git add'
alias gc='git checkout'
alias gaa='git add .'
alias gaf='git add -f'
alias gap='git add -p'
alias gca='git commit --amend'
alias gima='git commit -a -m'
alias gim='git commit -m'
alias gp='git push'
alias gfp='git push --force-with-lease'
alias gri='git rebase -i'
alias grc='git rebase --continue'
alias gra='git rebase --abort'
alias gpr='git pull -r'
alias gst='git stash'
alias gsp='git stash pop'
##Diff in latest/last 2 commits
alias gl='git log'
alias gls='git log --pretty=oneline --abbrev-commit'
alias glss='git log --show-signature --pretty=oneline --abbrev-commit'
alias glg='git log --all --decorate --oneline --graph'
##Files in latest/last 2 commits  
alias gl2='git log -p -2'
##Diff of latest commit
alias gl1='git log -p -1'
# show content of last commit (HEAD)
alias gsh='git show HEAD'
#help
alias ghh='cat "$BYTELYST_ALIAS_DIR/_git.alias"'
