Skip to content

Instantly share code, notes, and snippets.

@roc
Created February 7, 2013 10:36
Show Gist options
  • Save roc/4730161 to your computer and use it in GitHub Desktop.
Save roc/4730161 to your computer and use it in GitHub Desktop.
Pushups and Pullups for your bash, because gym metaphors work really well with git wrangling.
# should return current branch
function current_branch() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || \
ref=$(git rev-parse --short HEAD 2> /dev/null) || return
echo ${ref#refs/heads/}
}
alias pullup='git pull origin $(current_branch)'
alias pushup='git push origin $(current_branch)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment