Skip to content

Commit 982c525

Browse files
committed
Recommend users to rename their fork's default branch
1 parent 2740087 commit 982c525

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

content/inside-rust/renaming-the-default-branch-of-rust-lang-rust.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ We will be renaming the default branch of the [rust-lang/rust repository](https:
1313

1414
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.
1515

16-
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+
After the rename, contributors will need to run the following commands in their local checkout of the repository, assuming that your upstream remote is called `origin`:
1717

1818
```bash
1919
git branch -m master main
@@ -27,6 +27,8 @@ git remote prune origin
2727

2828
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].
2929

30+
**We recommend you to rename the default branch of your fork.** If you do not do it, and you will some day type `git checkout master` from muscle memory, git will create a fresh `master` branch based on your fork's `master` branch, which will be outdated. This behavior can be quite confusing.
31+
3032
[github-change]: https://github.blog/changelog/2020-10-01-the-default-branch-for-newly-created-repositories-is-now-main/
3133

3234
[github-tooling]: https://github.com/github/renaming

0 commit comments

Comments
 (0)