Skip to content

Instantly share code, notes, and snippets.

@fsouza
Created September 27, 2010 12:08
Show Gist options
  • Save fsouza/598919 to your computer and use it in GitHub Desktop.
Save fsouza/598919 to your computer and use it in GitHub Desktop.
# Push git changes. $1 = destination branch
function git_push() {
typeset current_branch=$(parse_git_branch)
typeset destination_branch="$1"
if [ "$destination_branch" = "" ]
then
typeset destination_branch="master"
fi
git checkout $destination_branch; git merge $current_branch; git pull origin $destination_branch; git push origin $destination_branch; git checkout $current_branch
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment