Skip to content

Instantly share code, notes, and snippets.

@schnell18
Created February 14, 2014 01:30
Show Gist options
  • Save schnell18/8994224 to your computer and use it in GitHub Desktop.
Save schnell18/8994224 to your computer and use it in GitHub Desktop.
Replace master branch with different name. If you want to set up master branch with a different name, try these commands.
git checkout master
git checkout -b <NEW_NAME_FOR_MASTER>
git symbolic-ref HEAD refs/heads/<NEW_NAME_FOR_MASTER>
git branch -D master
@schnell18
Copy link
Author

The key is to run the git symbolic-ref command which set the new branch active, and any new clone of this repository use the new branch as master automatically.

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