Our default branch is now `main`

AI-generated summary

The Discourse team has renamed the main branch in their repository from master to main to avoid slavery references. This change was made after slowly updating their code base to support it. Some things may break, and users are asked to report any errors encountered. To update a local copy of Discourse, developers can use the following commands:

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

eviltrout notes that most plugins and theme components have already been updated. However, pfaffman points out that some projects, such as discourse_docker and discourse_api, still use the master branch. eviltrout assures that these projects will be updated soon.

For most users, this change will not affect how they update Discourse via the command line. As pfaffman explains, it only matters for developers who are familiar with Git branches. Richie shares their update command, which remains unchanged:

cd /var/discourse
git pull
./launcher rebuild app
```

As of this morning, our main repo discourse/discourse has renamed its main branch from master to main to avoid slavery references.

We’ve spent a long time slowly renaming all our branches and updating our code base to support this change. However, some things may break. Please use this topic to report any errors you encounter.

If you already have a version of discourse checked out on your computer for development you will have to rename it. Github conveniently offers the following instructions:

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

Thanks for the fix. I was wondering when this was going to happen. But now I want to know if and when you’ll be doing the rest…

What do you mean by the rest? I believe every plug-in and theme component has already been updated.

Funny. Now when I checked some others in my discourse-repos I see that you’re right! But the first one I checked was discourse_docker, and it and discourse_api (and discourse-plugin-ci, which I think I, and perhaps everyone, should delete) still have master.

Reading your announcement again, I don’t see that you explicitly say that you did it for all the plugins and theme components (I think that’s what you mean by “all our branches”, but it wasn’t clear). Oh, and the first sentence refers explicitly to discourse/discourse, which I think also lead me to believe that you mean just discourse/discourse.

Ah, I understand the confusion. Almost every sub project was renamed quite some time ago so this announcement was meant to say “and the core project is now done, too.”

As for those other projects, we’ll get to them soon. We actually have hundreds of repos and a handful might have been waiting for this to go through.

Excuse my ignorance here, but will this change the way I usually update my Discourse via command line?

What commands do you type to update via command line?

No. It matters only if you’re a developer and know what a git branch is.

I use:

cd /var/discourse
git pull
./launcher rebuild app

Thanks :blush: