Skip to content

Instantly share code, notes, and snippets.

@steveburkett
Created June 15, 2011 16:47
Show Gist options
  • Save steveburkett/1027521 to your computer and use it in GitHub Desktop.
Save steveburkett/1027521 to your computer and use it in GitHub Desktop.
make a new master branch in git
#archive the master
git checkout -b master_archive
git push origin master_archive
#delete old master
git checkout development
git branch -D master
git push origin :master #push empty ref up; force deletion
#branch new master off of development
git checkout -b master
git push origin master
#fix upstream reference to master
git checkout development
git branch -D master #delete local branch of master
git checkout -b master origin/master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment