Git master/main branch fixup


Update a local repo for when an origin’s primary branch changes from master to main

git branch -m master main
git fetch origin
git branch -u origin/main main
git remote set-head origin -a

Source: Github popup when you use their UI to make the change.

Date: 2021-12-24

Tags:  git

Share: