Skip to content

Commit 74c59b4

Browse files
authored
Merge pull request #1722 from integer32llc/rename-branch
Post on renaming the default branch of rust-lang/rust
2 parents 9a1aae3 + d4b6b24 commit 74c59b4

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
+++
2+
path = "inside-rust/2025/10/16/renaming-the-default-branch-of-rust-langrust"
3+
title = "Renaming the default branch of rust-lang/rust"
4+
authors = ["Jake Goulding"]
5+
6+
[extra]
7+
team = "the Infra team"
8+
team_url = "https://www.rust-lang.org/governance/teams/infra#team-infra"
9+
+++
10+
11+
We will be renaming the default branch of the [rust-lang/rust repository](https://github.com/rust-lang/rust) from `master` to `main` on 2025-11-10. We've chosen `main` specifically as it's the [new default in git][git-change] and the renaming will leverage the [GitHub tooling][github-tooling] built to make this easier.
12+
13+
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.
14+
15+
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`:
16+
17+
```bash
18+
git branch -m master main
19+
git fetch origin
20+
git branch -u origin/main main
21+
git remote set-head origin -a
22+
23+
# optional
24+
git remote prune origin
25+
```
26+
27+
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][github-how-to-rename].
28+
29+
[git-change]: https://lore.kernel.org/git/[email protected]/
30+
31+
[github-tooling]: https://github.com/github/renaming
32+
33+
[github-how-to-rename]: https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-branches-in-your-repository/changing-the-default-branch

0 commit comments

Comments
 (0)