Created
July 26, 2021 05:31
-
-
Save erictleung/43fea268292dce118f32cf0ad2e1292c to your computer and use it in GitHub Desktop.
Update local git repository from master to main branch on upstream
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
# Sources: | |
# - https://www.git-tower.com/learn/git/faq/git-rename-master-to-main/ | |
# - https://gist.github.com/kelynch/9ba595e369c304b560477f3636b41e8a | |
git checkout master # Assumes master is default branch | |
git branch -m master main | |
git fetch origin | |
git branch -u origin/main main | |
git remote set-head origin -a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment