Skip to content

Instantly share code, notes, and snippets.

@benhoskings
Created September 19, 2013 07:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benhoskings/6619930 to your computer and use it in GitHub Desktop.
Save benhoskings/6619930 to your computer and use it in GitHub Desktop.
Pushing specific git branches
git_current_branch() {
cat "$(git rev-parse --git-dir 2>/dev/null)/HEAD" | sed -e 's/^.*refs\/heads\///'
}
alias gpthis='gp origin $(git_current_branch)'
alias gpthis!='gp --set-upstream origin $(git_current_branch)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment