Skip to content

Instantly share code, notes, and snippets.

@13k
Created April 6, 2009 20:36
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 13k/90928 to your computer and use it in GitHub Desktop.
Save 13k/90928 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Pushes current branch to remote branch possibly with different names
# With no arguments, pushes to origin +<branch>:<branch> where <branch>
# is the same branch name as current.
# With one argument, pushes to origin +<branch>:<argument>
head=`git symbolic-ref HEAD`
branch=`basename $head`
git push origin +$branch:${1:-$branch}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment