]> git.rmz.io Git - dotfiles.git/blobdiff - zsh/aliases/git.zsh
zsh: add --cherry-mark and --boundary flags to `glgl`
[dotfiles.git] / zsh / aliases / git.zsh
index 2d1b72e56a2035b6225b8f1ca8fde1999e976cc3..9046d080a620bc9e0b3b10bdeec3ab8f0df8d008 100644 (file)
@@ -8,14 +8,18 @@ alias gl='git pull'
 alias gup='git pull --rebase'
 
 alias gp='git push'
+alias gpf='git push --force-with-lease'
 
 alias gd='git diff'
 alias gdc='git diff --cached'
+function gdm { gd "${1:-origin}".. }
+compdef _git gdm=git-diff
 
 alias gc='git commit -v'
 alias gcs='git commit -v --squash'
 alias gcf='git commit -v --fixup'
 alias gca='git commit -v -a'
+alias gcaf='git commit -v -a --fixup'
 
 alias gco='git checkout'
 alias gcm='git checkout master'
@@ -34,21 +38,24 @@ alias grrm='git remote remove'
 alias grset='git remote set-url'
 alias grup='git remote update'
 
-alias gb='git branch'
+alias gb='git branch -vv'
 alias gba='git branch -a'
 alias gbm='git branch --merged'
-alias gbdm='git branch --merged | grep -ve "\*" -e "master" | xargs -n 1 git branch -d'
+alias gbdm='git branch --merged | grep -ve "\*" -e "master" | xargs git branch -d'
 
 alias gcl='git config --list'
 alias gcp='git cherry-pick'
 
 alias gcount='git shortlog -sn'
-alias glg='git --no-pager log --oneline --graph --max-count=20 --decorate'
 alias glg='git --no-pager log --graph --max-count=20 --pretty=tformat:"%Cblue%cd %C(auto)%h%d %s" --date=short'
-alias glgl='git log --graph --pretty=tformat:"%Cblue%cd %C(auto)%h%d %s" --date=short'
+function glm { glg "${1:-origin}".. }
+compdef _git glm=git-log
+alias glgl='git log --graph --cherry-mark --boundary --pretty=tformat:"%Cblue%cd %C(auto)%h%d %s" --date=short'
 alias glgg='git log --stat --graph --max-count=20 --decorate'
 alias glgga='git log --stat --graph --decorate --all'
 
+alias grl='git --no-pager reflog --max-count=20'
+
 alias ga='git add'
 
 alias gm='git merge'
@@ -64,7 +71,7 @@ alias gpoat='git push origin --all && git push origin --tags'
 
 # cd into the top of the current repository
 # or submodule.
-alias grt='cd $(git rev-parse --show-toplevel || echo ".")'
+alias cdr='cd $(git rev-parse --show-toplevel || echo ".")'
 
 # Git and svn mix
 alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'