Skip to content

Instantly share code, notes, and snippets.

@jeffgca
Created December 31, 2010 22:48
Show Gist options
  • Save jeffgca/761396 to your computer and use it in GitHub Desktop.
Save jeffgca/761396 to your computer and use it in GitHub Desktop.
Nice git push and pull aliases
# from here: http://stackoverflow.com/questions/948354/git-push-current-branch/948364#948364
get_git_branch() {
echo `git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
}
alias gpull='git pull origin `get_git_branch`'
alias gpush='git push origin `get_git_branch`'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment