Skip to content

Instantly share code, notes, and snippets.

@cassidoo
Created December 26, 2014 21:30
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cassidoo/847854571d7fc155648c to your computer and use it in GitHub Desktop.
Save cassidoo/847854571d7fc155648c to your computer and use it in GitHub Desktop.
Sync two branches in git
# Put in ~/.bash_profile
# Usage:
# > sync master gh-pages
# Equivalent to:
# > git push origin master
# > git checkout gh-pages
# > git rebase master
# > git push origin gh-pages
# > git checkout master
function sync {
git push origin $1
git checkout $2
git rebase $1
git push origin $2
git checkout $1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment