Skip to content

Instantly share code, notes, and snippets.

@tomasv
Last active August 29, 2015 14:15
Show Gist options
  • Save tomasv/214bd191023a65b78049 to your computer and use it in GitHub Desktop.
Save tomasv/214bd191023a65b78049 to your computer and use it in GitHub Desktop.
function git-mode() {
alias gst='git status'
alias st='git status'
alias gco='git checkout'
alias co='git checkout'
alias gbr='git branch'
alias br='git branch'
alias gcommit='git commit'
alias commit='git commit'
alias gdiff='git diff'
alias gpull='git pull'
alias pull='git pull'
alias gpush='git push'
alias push='git push'
alias gamend='git commit --amend'
alias amend='git commit --amend'
alias amend!='git commit --amend --no-edit'
alias grebase='git rebase'
alias rebase='git rebase'
alias gadd='git add'
alias add='git add'
alias gshow='git show'
alias show='git show'
alias glog='git log'
alias gstg='git diff --staged'
alias stg='git diff --staged'
alias diff='git diff'
alias log='git log'
alias greset='git reset'
alias reset='git reset'
alias stash='git stash'
alias pop='git stash pop'
alias 'reset-1'='git reset head~1'
alias clean='git clean'
alias gcontinue='git rebase --continue'
alias gabort='git rebase --abort'
alias master='git checkout master'
# custom
alias clean-merged='git clean-merged'
alias wip='git wip'
alias pull-request='hub pull-request'
function new_prefixed_branch() { git checkout -b "$1/$2" }
function feature() { new_prefixed_branch features $1 }
function bugfix() { new_prefixed_branch bugfix $1 }
function refactor() { new_prefixed_branch refactor $1 }
}
git-mode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment