Created
June 12, 2020 13:06
-
-
Save daneden/c55160e7997318f23dc4264d21919fd9 to your computer and use it in GitHub Desktop.
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 | |
# Checkout master branch | |
git checkout master | |
# Rename "master" to "main" | |
git branch -m master main | |
# Unset the current upstream branch | |
git branch --unset-upstream | |
# Publish the "main" branch as upstream | |
git push origin -u main | |
# Delete the "master" branch from origin | |
# Note that this will cause an error from GitHub unless you go | |
# to the repo settings and change the default branch to "main" | |
git push origin --delete master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ohyeeeeeeeeeeeeeeeee thx u