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' |
4cd4167c |
compdef _git gup=git-fetch |
3cf9ab72 |
alias gp='git push' |
2e949296 |
compdef _git gp=git-push |
b3a78d2b |
gdv() { git-diff -w "$@" | view - } |
4cd4167c |
compdef _git gdv=git-diff |
3cf9ab72 |
alias gc='git commit -v' |
4cd4167c |
compdef _git gc=git-commit |
3cf9ab72 |
alias gca='git commit -v -a' |
4cd4167c |
compdef _git gca=git-commit |
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' |
4cd4167c |
compdef _git gba=git-branch |
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 |
6bb0c1c9 |
alias glgg='git log --graph --max-count=5'
compdef _git glgg=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 |
|
96b0af68 |
alias gsr='git svn rebase'
alias gsd='git svn dcommit' |
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 |