summary refs log tree commit diff
path: root/dot_local/share/zsh/git/git.plugin.zsh
blob: 8c7b36297189848458fcf8cc6d7ea8b6503333f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
alias g='git'

__git_aliases() {
    local IFS=$'\n'
    for _git_config_line in $(git config --list | grep -E '^alias\.' | cut -d. -f2-); do
        if ! which "g${_git_config_line%%=*}" &>/dev/null; then
            if [[ ${_git_config_line} = *'=!'* ]]; then
                alias "g${_git_config_line:s/=\!/=}"
            else
                alias "g${_git_config_line:s/=/=git }"
            fi
        fi
    done
}
__git_aliases
unset __git_aliases