Added option to skip git aliases definition

Fixes #947
main
Eduardo San Martin Morote 10 years ago committed by Kaleb Elwert
parent 27c2ccd8b9
commit c0049855c5

@ -29,6 +29,10 @@ This setting affects all aliases and functions that call `git-status`.
Aliases Aliases
------- -------
Aliases are enabled by default. You can disable them with:
zstyle ':prezto:module:git:alias' skip 'yes'
### Git ### Git
- `g` is short for `git`. - `g` is short for `git`.

@ -26,157 +26,159 @@ zstyle -s ':prezto:module:git:status:ignore' submodules '_git_status_ignore_subm
# Aliases # Aliases
# #
# Git if ! zstyle -t ':prezto:module:git:alias' skip 'yes'; then
alias g='git' # Git
alias g='git'
# Branch (b)
alias gb='git branch' # Branch (b)
alias gbc='git checkout -b' alias gb='git branch'
alias gbl='git branch -v' alias gbc='git checkout -b'
alias gbL='git branch -av' alias gbl='git branch -v'
alias gbx='git branch -d' alias gbL='git branch -av'
alias gbX='git branch -D' alias gbx='git branch -d'
alias gbm='git branch -m' alias gbX='git branch -D'
alias gbM='git branch -M' alias gbm='git branch -m'
alias gbs='git show-branch' alias gbM='git branch -M'
alias gbS='git show-branch -a' alias gbs='git show-branch'
alias gbS='git show-branch -a'
# Commit (c)
alias gc='git commit --verbose' # Commit (c)
alias gca='git commit --verbose --all' alias gc='git commit --verbose'
alias gcm='git commit --message' alias gca='git commit --verbose --all'
alias gco='git checkout' alias gcm='git commit --message'
alias gcO='git checkout --patch' alias gco='git checkout'
alias gcf='git commit --amend --reuse-message HEAD' alias gcO='git checkout --patch'
alias gcF='git commit --verbose --amend' alias gcf='git commit --amend --reuse-message HEAD'
alias gcp='git cherry-pick --ff' alias gcF='git commit --verbose --amend'
alias gcP='git cherry-pick --no-commit' alias gcp='git cherry-pick --ff'
alias gcr='git revert' alias gcP='git cherry-pick --no-commit'
alias gcR='git reset "HEAD^"' alias gcr='git revert'
alias gcs='git show' alias gcR='git reset "HEAD^"'
alias gcl='git-commit-lost' alias gcs='git show'
alias gcl='git-commit-lost'
# Conflict (C)
alias gCl='git status | sed -n "s/^.*both [a-z]*ed: *//p"' # Conflict (C)
alias gCa='git add $(gCl)' alias gCl='git status | sed -n "s/^.*both [a-z]*ed: *//p"'
alias gCe='git mergetool $(gCl)' alias gCa='git add $(gCl)'
alias gCo='git checkout --ours --' alias gCe='git mergetool $(gCl)'
alias gCO='gCo $(gCl)' alias gCo='git checkout --ours --'
alias gCt='git checkout --theirs --' alias gCO='gCo $(gCl)'
alias gCT='gCt $(gCl)' alias gCt='git checkout --theirs --'
alias gCT='gCt $(gCl)'
# Data (d)
alias gd='git ls-files' # Data (d)
alias gdc='git ls-files --cached' alias gd='git ls-files'
alias gdx='git ls-files --deleted' alias gdc='git ls-files --cached'
alias gdm='git ls-files --modified' alias gdx='git ls-files --deleted'
alias gdu='git ls-files --other --exclude-standard' alias gdm='git ls-files --modified'
alias gdk='git ls-files --killed' alias gdu='git ls-files --other --exclude-standard'
alias gdi='git status --porcelain --short --ignored | sed -n "s/^!! //p"' alias gdk='git ls-files --killed'
alias gdi='git status --porcelain --short --ignored | sed -n "s/^!! //p"'
# Fetch (f)
alias gf='git fetch' # Fetch (f)
alias gfc='git clone' alias gf='git fetch'
alias gfm='git pull' alias gfc='git clone'
alias gfr='git pull --rebase' alias gfm='git pull'
alias gfr='git pull --rebase'
# Grep (g)
alias gg='git grep' # Grep (g)
alias ggi='git grep --ignore-case' alias gg='git grep'
alias ggl='git grep --files-with-matches' alias ggi='git grep --ignore-case'
alias ggL='git grep --files-without-matches' alias ggl='git grep --files-with-matches'
alias ggv='git grep --invert-match' alias ggL='git grep --files-without-matches'
alias ggw='git grep --word-regexp' alias ggv='git grep --invert-match'
alias ggw='git grep --word-regexp'
# Index (i)
alias gia='git add' # Index (i)
alias giA='git add --patch' alias gia='git add'
alias giu='git add --update' alias giA='git add --patch'
alias gid='git diff --no-ext-diff --cached' alias giu='git add --update'
alias giD='git diff --no-ext-diff --cached --word-diff' alias gid='git diff --no-ext-diff --cached'
alias gir='git reset' alias giD='git diff --no-ext-diff --cached --word-diff'
alias giR='git reset --patch' alias gir='git reset'
alias gix='git rm -r --cached' alias giR='git reset --patch'
alias giX='git rm -rf --cached' alias gix='git rm -r --cached'
alias giX='git rm -rf --cached'
# Log (l)
alias gl='git log --topo-order --pretty=format:"${_git_log_medium_format}"' # Log (l)
alias gls='git log --topo-order --stat --pretty=format:"${_git_log_medium_format}"' alias gl='git log --topo-order --pretty=format:"${_git_log_medium_format}"'
alias gld='git log --topo-order --stat --patch --full-diff --pretty=format:"${_git_log_medium_format}"' alias gls='git log --topo-order --stat --pretty=format:"${_git_log_medium_format}"'
alias glo='git log --topo-order --pretty=format:"${_git_log_oneline_format}"' alias gld='git log --topo-order --stat --patch --full-diff --pretty=format:"${_git_log_medium_format}"'
alias glg='git log --topo-order --all --graph --pretty=format:"${_git_log_oneline_format}"' alias glo='git log --topo-order --pretty=format:"${_git_log_oneline_format}"'
alias glb='git log --topo-order --pretty=format:"${_git_log_brief_format}"' alias glg='git log --topo-order --all --graph --pretty=format:"${_git_log_oneline_format}"'
alias glc='git shortlog --summary --numbered' alias glb='git log --topo-order --pretty=format:"${_git_log_brief_format}"'
alias glc='git shortlog --summary --numbered'
# Merge (m)
alias gm='git merge' # Merge (m)
alias gmC='git merge --no-commit' alias gm='git merge'
alias gmF='git merge --no-ff' alias gmC='git merge --no-commit'
alias gma='git merge --abort' alias gmF='git merge --no-ff'
alias gmt='git mergetool' alias gma='git merge --abort'
alias gmt='git mergetool'
# Push (p)
alias gp='git push' # Push (p)
alias gpf='git push --force-with-lease' alias gp='git push'
alias gpF='git push --force' alias gpf='git push --force-with-lease'
alias gpa='git push --all' alias gpF='git push --force'
alias gpA='git push --all && git push --tags' alias gpa='git push --all'
alias gpt='git push --tags' alias gpA='git push --all && git push --tags'
alias gpc='git push --set-upstream origin "$(git-branch-current 2> /dev/null)"' alias gpt='git push --tags'
alias gpp='git pull origin "$(git-branch-current 2> /dev/null)" && git push origin "$(git-branch-current 2> /dev/null)"' alias gpc='git push --set-upstream origin "$(git-branch-current 2> /dev/null)"'
alias gpp='git pull origin "$(git-branch-current 2> /dev/null)" && git push origin "$(git-branch-current 2> /dev/null)"'
# Rebase (r)
alias gr='git rebase' # Rebase (r)
alias gra='git rebase --abort' alias gr='git rebase'
alias grc='git rebase --continue' alias gra='git rebase --abort'
alias gri='git rebase --interactive' alias grc='git rebase --continue'
alias grs='git rebase --skip' alias gri='git rebase --interactive'
alias grs='git rebase --skip'
# Remote (R)
alias gR='git remote' # Remote (R)
alias gRl='git remote --verbose' alias gR='git remote'
alias gRa='git remote add' alias gRl='git remote --verbose'
alias gRx='git remote rm' alias gRa='git remote add'
alias gRm='git remote rename' alias gRx='git remote rm'
alias gRu='git remote update' alias gRm='git remote rename'
alias gRp='git remote prune' alias gRu='git remote update'
alias gRs='git remote show' alias gRp='git remote prune'
alias gRb='git-hub-browse' alias gRs='git remote show'
alias gRb='git-hub-browse'
# Stash (s)
alias gs='git stash' # Stash (s)
alias gsa='git stash apply' alias gs='git stash'
alias gsx='git stash drop' alias gsa='git stash apply'
alias gsX='git-stash-clear-interactive' alias gsx='git stash drop'
alias gsl='git stash list' alias gsX='git-stash-clear-interactive'
alias gsL='git-stash-dropped' alias gsl='git stash list'
alias gsd='git stash show --patch --stat' alias gsL='git-stash-dropped'
alias gsp='git stash pop' alias gsd='git stash show --patch --stat'
alias gsr='git-stash-recover' alias gsp='git stash pop'
alias gss='git stash save --include-untracked' alias gsr='git-stash-recover'
alias gsS='git stash save --patch --no-keep-index' alias gss='git stash save --include-untracked'
alias gsw='git stash save --include-untracked --keep-index' alias gsS='git stash save --patch --no-keep-index'
alias gsw='git stash save --include-untracked --keep-index'
# Submodule (S)
alias gS='git submodule' # Submodule (S)
alias gSa='git submodule add' alias gS='git submodule'
alias gSf='git submodule foreach' alias gSa='git submodule add'
alias gSi='git submodule init' alias gSf='git submodule foreach'
alias gSI='git submodule update --init --recursive' alias gSi='git submodule init'
alias gSl='git submodule status' alias gSI='git submodule update --init --recursive'
alias gSm='git-submodule-move' alias gSl='git submodule status'
alias gSs='git submodule sync' alias gSm='git-submodule-move'
alias gSu='git submodule foreach git pull origin master' alias gSs='git submodule sync'
alias gSx='git-submodule-remove' alias gSu='git submodule foreach git pull origin master'
alias gSx='git-submodule-remove'
# Working Copy (w)
alias gws='git status --ignore-submodules=${_git_status_ignore_submodules} --short' # Working Copy (w)
alias gwS='git status --ignore-submodules=${_git_status_ignore_submodules}' alias gws='git status --ignore-submodules=${_git_status_ignore_submodules} --short'
alias gwd='git diff --no-ext-diff' alias gwS='git status --ignore-submodules=${_git_status_ignore_submodules}'
alias gwD='git diff --no-ext-diff --word-diff' alias gwd='git diff --no-ext-diff'
alias gwr='git reset --soft' alias gwD='git diff --no-ext-diff --word-diff'
alias gwR='git reset --hard' alias gwr='git reset --soft'
alias gwc='git clean -n' alias gwR='git reset --hard'
alias gwC='git clean -f' alias gwc='git clean -n'
alias gwx='git rm -r' alias gwC='git clean -f'
alias gwX='git rm -rf' alias gwx='git rm -r'
alias gwX='git rm -rf'
fi

Loading…
Cancel
Save