X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/41017a0736d193f54236173222e7e4d476642d04..0d89e0b38f04e0dc6fd0e2b51efa044bd3ccfc5a:/zsh/aliases/git.zsh?ds=sidebyside diff --git a/zsh/aliases/git.zsh b/zsh/aliases/git.zsh index 2d1b72e..dbf552e 100644 --- a/zsh/aliases/git.zsh +++ b/zsh/aliases/git.zsh @@ -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,10 +38,10 @@ 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' @@ -45,6 +49,8 @@ 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' +function glm { glg "${1:-origin}".. } +compdef _git glm=git-log alias glgl='git log --graph --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' @@ -64,7 +70,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'