Skip to content

Instantly share code, notes, and snippets.

@danpozmanter
Last active November 24, 2020 06:42
Show Gist options
  • Save danpozmanter/a3a7622e5c1531bb18f0a4a6dad627f7 to your computer and use it in GitHub Desktop.
Save danpozmanter/a3a7622e5c1531bb18f0a4a6dad627f7 to your computer and use it in GitHub Desktop.
Rename your master branch to main
git branch -m master main
git push origin main
echo "In Github: Navigate to your repository settings/branches."
echo "If your branch has been added you'll be able to switch your default from master to main."
echo "------------------------------------"
echo "In Gitlab: Navigate to your project settings/branches."
echo "Then change your default to main."
echo "If your master is protected remove it and replace with main."
echo "------------------------------------"
echo "Make any changes relevant to deployment!"
echo "Hit <ENTER> when done."
read _
git push origin :master
git branch --set-upstream-to=origin/main main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment