Created
October 29, 2021 18:38
-
-
Save julianhyde/79a733e524d0d4f09f51dcbf78128821 to your computer and use it in GitHub Desktop.
How to fix a GitHub clone after the remote 'master' branch has been renamed 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
# (Instructions are based on the "What Your Teammates Have to Do" section | |
# in https://www.git-tower.com/learn/git/faq/git-rename-master-to-main.) | |
# Switch to the "master" branch: | |
$ git checkout master | |
# Rename it to "main": | |
$ git branch -m master main | |
# Get the latest commits (and branches!) from the remote: | |
$ git fetch | |
# Remove the existing tracking connection with "origin/master": | |
$ git branch --unset-upstream | |
# Create a new tracking connection with the new "origin/main" branch: | |
$ git branch -u origin/main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment