Migrating thoughtbot Repositories to use Main as default branch

Brian Tenggren

In the upcoming week thoughtbot will be migrating all of it’s Github hosted repositories to use “main” as our default branch. The “master” branch will be deleted from Github.

What that means for you

Most likely, you will be unaffected by this change.

If you have checked out projects locally you may need to run the following to rename your branch.

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

Optionally, you can also remove old references to “master” branch

git remote prune origin

If you’ve hard-coded any scripts or dependencies for your project to pull the “master” branch, you will need to rename them to “main” or use any of the release versions. The “master” branch will be deleted as part of the change and you should expect errors.

For more info on why

See Our Previous Blog post

If you’re interested in resources to move your Github repositories

See Github’s Docs on Changing the Default Branch or Github’s Docs on Renaming a Branch.