Renaming the default branch of rust-lang/rust

Oct. 16, 2025 · Jake Goulding on behalf of the Infra team

We will be renaming the default branch of the rust-lang/rust repository from master to main on 2025-11-10. We've chosen main specifically as it's the default for newly-created repositories in GitHub and the renaming will leverage the GitHub tooling built to make this easier.

If you maintain a tool that currently assumes the default branch of rust-lang/rust is named master, using HEAD instead will work both before and after the rename.

After the rename, contributors will need to run the following commands in their local checkout of the repository, assuming that your remote registry is called origin:

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

# optional
git remote prune origin

If you have a fork of the rust-lang/rust repository on GitHub and would like to rename your default branch to match, you can follow GitHub's instructions.