Skip to content

Instantly share code, notes, and snippets.

@pyrat
Created September 5, 2011 20:14
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 pyrat/1195816 to your computer and use it in GitHub Desktop.
Save pyrat/1195816 to your computer and use it in GitHub Desktop.
renaming git branches locally and on github
git branch -m master legacy 
git branch -m dev master

Set default branch in admin not master.
Delete the remote master branch on GitHub.

git push origin :master

Push up the new master to GitHub.

git push origin master:refs/heads/master

On the GitHub repo, change the default branch back to ‘master’

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment