From 41b181ff37509f98593b11a74b8deabdc187e3bd Mon Sep 17 00:00:00 2001 From: ncanceill Date: Sat, 24 May 2014 19:24:19 +0200 Subject: [PATCH] add aliases from #2494 --- plugins/git/git.plugin.zsh | 55 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index c5efb4087..3821a2e4b 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -62,6 +62,10 @@ compdef _git gup=git-fetch # Push alias gp='git push' compdef _git gp=git-push +alias gpf='git push --force' +compdef _git gpf=git-push +alias gpd='git push --dry-run' +compdef _git gpd=git-push alias gpoat='git push origin --all && git push origin --tags' compdef _git gpoat=git-push # Commit @@ -96,14 +100,36 @@ compdef _git grset=git-remote # Rebase alias grb='git rebase' compdef _git grb=git-rebase -alias grbi='git rebase -i' -compdef _git grbi=git-rebase alias grbc='git rebase --continue' compdef _git grbc=git-rebase alias grbs='git rebase --skip' compdef _git grbs=git-rebase alias grba='git rebase --abort' compdef _git grba=git-rebase +alias grbm='git rebase master' +compdef _git grbm=git-rebase +alias grbi='git rebase -i' +compdef _git grbi=git-rebase +alias gr1='git rebase -i HEAD~' +compdef _git gr1=git-rebase +alias gr2='git rebase -i HEAD~2' +compdef _git gr2=git-rebase +alias gr3='git rebase -i HEAD~3' +compdef _git gr3=git-rebase +alias gr4='git rebase -i HEAD~4' +compdef _git gr4=git-rebase +alias gr5='git rebase -i HEAD~5' +compdef _git gr5=git-rebase +alias gr6='git rebase -i HEAD~6' +compdef _git gr6=git-rebase +alias gr7='git rebase -i HEAD~7' +compdef _git gr7=git-rebase +alias gr8='git rebase -i HEAD~8' +compdef _git gr8=git-rebase +alias gr9='git rebase -i HEAD~9' +compdef _git gr9=git-rebase +alias gr10='git rebase -i HEAD~10' +compdef _git gr10=git-rebase # Cherry-pick alias gcp='git cherry-pick' compdef _git gcp=git-cherry-pick @@ -121,8 +147,12 @@ compdef _git ga=git-add # Merge alias gm='git merge' compdef _git gm=git-merge +alias gmum='git merge upstream/master' +compdef _git gmum=git-merge alias gmt='git mergetool --no-prompt' compdef _git gmt=git-mergetool +alias gmtvim='git mergetool --no-prompt --tool=vimdiff' +compdef _git gmtvim=git-mergetool # Reset alias grh='git reset HEAD' compdef _git grh=git-reset @@ -144,6 +174,8 @@ alias glo='git log --oneline --decorate --color' compdef _git glo=git-log alias glog='git log --oneline --decorate --color --graph' compdef _git glog=git-log +alias glgm='git log --graph --max-count=10' +compdef _git glgm=git-log alias gwch='git whatchanged -p --abbrev-commit --pretty=medium' compdef _git gwch=git-whatchanged alias glp="_git_log_prettily" @@ -154,10 +186,29 @@ alias gga='git gui citool --amend' alias gk='gitk --all --branches' # Stash alias gsts='git stash show --text' +compdef _git gsts='git-stash' alias gsta='git stash' +compdef _git gsta='git-stash' alias gstp='git stash pop' +compdef _git gstp='git-stash' alias gstd='git stash drop' +compdef _git gstd='git-stash' alias gstl='git stash list' +compdef _git gstl='git-stash' +alias gstaa='git stash apply' +compdef _git gstaa='git-stash' +# Gitk +alias gk='\gitk --all --branches' +compdef _git gk='gitk' +# show complete history, with dangling commits +# Note: if the commit has been cleaned by 'git gc', the dangling +# commits older than 2 weeks may have been deleted +alias gke='\gitk --all $(git log -g --pretty=format:%h)' +compdef _git gke='gitk' +# Remove all .orig, .BASE.*, .REMOTE.*, .LOCAL.*, *.BACKUP files +alias gclean="find . -name '*.orig' -or -name '*.REMOTE.*' -or \ +-name '*.LOCAL.*' -or -name '*.BACKUP.*' -or -name '*.BASE.*' | \ +xargs $XARGS_OPTS rm -v" # cd into the top of the current repository or submodule alias grt='cd $(git rev-parse --show-toplevel || echo ".")' # Git and svn mix