Skip to content

Instantly share code, notes, and snippets.

@ilyaashapatov
Forked from saippuakauppias/gist:3430432
Last active September 7, 2015 13:47
Show Gist options
  • Save ilyaashapatov/69a95dc3a4a31d4f22e5 to your computer and use it in GitHub Desktop.
Save ilyaashapatov/69a95dc3a4a31d4f22e5 to your computer and use it in GitHub Desktop.
git shortcuts
alias g='git'
alias gst='git status'
alias gc='git commit -a -m'
alias gco='git checkout'
alias gcm='git checkout master'
alias gb='git branch'
alias glg='git log --stat --max-count=5'
alias ga='git add .'
alias gsh='git stash'
alias gsha='git stash apply'
alias gd='git diff'
function current_branch() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo ${ref#refs/heads/}
}
alias ggpull='git pull origin $(current_branch)'
alias ggpush='git push origin $(current_branch)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment