---
title: Migrating thoughtbot Repositories to use Main as default branch
teaser: thoughtbot is moving all of it's GitHub Repositories to use "main" as the
  default branch.
tags: news,git
author: Brian Tenggren
published_on: 2021-09-16
---

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. 

```sh
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 

```sh
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](https://thoughtbot.com/blog/it-s-time-for-a-new-branch)

## If you're interested in resources to move your Github repositories

See [Github's Docs on Changing the Default Branch](https://docs.github.com/en/github/administering-a-repository/managing-branches-in-your-repository/changing-the-default-branch) or [Github's Docs on Renaming a Branch](https://docs.github.com/en/github/administering-a-repository/managing-branches-in-your-repository/renaming-a-branch).
