Created
December 26, 2014 21:30
-
-
Save cassidoo/847854571d7fc155648c to your computer and use it in GitHub Desktop.
Sync two branches in git
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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