The project we are using had its master
branch moved to main
, on GitLab for reasons of consistency.
Locally I had renamed the master branch to main:
git branch -m master main
This seemed to be enough until I accidentally did git checkout master
and then it recreated the master branch. Doing a git branch -a
, I see I now have the following two remotes (in addition to my other ones):
remotes/origin/main
remotes/origin/master
How do a tell the local repo to forget about remotes/origin/master
, to avoid accidentally recreating master
, when I mean to switch to the main
branch?