3cf9ab72 |
# Aliases
alias g='git' |
57f55e69 |
compdef g=git |
3cf9ab72 |
alias gst='git status' |
2e949296 |
compdef _git gst=git-status |
3cf9ab72 |
alias gl='git pull' |
2e949296 |
compdef _git gl=git-pull |
3cf9ab72 |
alias gup='git fetch && git rebase' |
57f55e69 |
compdef gup=git |
3cf9ab72 |
alias gp='git push' |
2e949296 |
compdef _git gp=git-push |
3cf9ab72 |
alias gd='git diff | mate' |
2e949296 |
# WTF is mate??
compdef _git gd=git-diff |
3cf9ab72 |
alias gdv='git diff -w "$@" | vim -R -' |
57f55e69 |
compdef gdv=git |
3cf9ab72 |
alias gc='git commit -v' |
57f55e69 |
compdef gc=git |
3cf9ab72 |
alias gca='git commit -v -a' |
57f55e69 |
compdef gca=git |
8edf4173 |
alias gco='git checkout' |
2e949296 |
compdef _git gco=git-checkout |
3cf9ab72 |
alias gb='git branch' |
2e949296 |
compdef _git gb=git-branch |
3cf9ab72 |
alias gba='git branch -a' |
57f55e69 |
compdef gba=git |
3cf9ab72 |
alias gcount='git shortlog -sn' |
57f55e69 |
compdef gcount=git |
3cf9ab72 |
alias gcp='git cherry-pick' |
2e949296 |
compdef _git gcp=git-cherry-pick |
dfbed8fd |
alias glg='git log --stat --max-count=5' |
2e949296 |
compdef _git glg=git-log |
3cf9ab72 |
# Git and svn mix
alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' |
2e949296 |
compdef git-svn-dcommit-push=git |
3cf9ab72 |
|
27904c11 |
#
# Will return the current branch name
# Usage example: git pull origin $(current_branch)
#
function current_branch() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo ${ref#refs/heads/}
}
|
1a8ceef5 |
# these aliases take advantage of the previous function |
3cf9ab72 |
alias ggpull='git pull origin $(current_branch)' |
57f55e69 |
compdef ggpull=git |
3cf9ab72 |
alias ggpush='git push origin $(current_branch)' |
57f55e69 |
compdef ggpush=git |
1a8ceef5 |
alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)' |
57f55e69 |
compdef ggpnp=git |