Created
June 15, 2020 10:42
-
-
Save diversemix/eea486a9d680d64b319e924cb4bd4572 to your computer and use it in GitHub Desktop.
Local script to rename master branch to main
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
#!/bin/bash | |
git checkout master | |
git pull | |
git branch -m master main | |
git push -u origin main | |
git checkout main | |
echo "Go to the repo Settings > Branches > Default Branch. Change it to the new branch press [ENTER]" | |
read finished | |
git branch -d master # delete local master | |
git push --delete origin master # delete remote master | |
git remote prune origin # delete the remote tracking branch | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment