Skip to content

Commit bb301cf

Browse files
committed
update mentions of default branch of rust-lang/rust
1 parent 02ba22e commit bb301cf

File tree

10 files changed

+60
-60
lines changed

10 files changed

+60
-60
lines changed

src/building/how-to-build-and-run.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ This instructs `git` to perform a "shallow clone", cloning the repository but tr
6868
the last `N` commits.
6969

7070
Passing `--depth 1` tells `git` to clone the repository but truncate the history to the latest
71-
commit that is on the `master` branch, which is usually fine for browsing the source code or
71+
commit that is on the `main` branch, which is usually fine for browsing the source code or
7272
building the compiler.
7373

7474
```bash

src/building/suggested.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ times, and having to update each clone individually.
389389
Fortunately, Git has a better solution called [worktrees]. This lets you create
390390
multiple "working trees", which all share the same Git database. Moreover,
391391
because all of the worktrees share the same object database, if you update a
392-
branch (e.g. master) in any of them, you can use the new commits from any of the
392+
branch in any of them, you can use the new commits from any of the
393393
worktrees. One caveat, though, is that submodules do not get shared. They will
394394
still be cloned multiple times.
395395

@@ -403,10 +403,10 @@ command:
403403
git worktree add ../rust2
404404
```
405405

406-
Creating a new worktree for a new branch based on `master` looks like:
406+
Creating a new worktree for a new branch based on `main` looks like:
407407

408408
```bash
409-
git worktree add -b my-feature ../rust2 master
409+
git worktree add -b my-feature ../rust2 main
410410
```
411411

412412
You can then use that rust2 folder as a separate workspace for modifying and

src/contributing.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Instead, we have 3 release channels: stable, beta, and nightly.
5555

5656
- **Stable**: this is the latest stable release for general usage.
5757
- **Beta**: this is the next release (will be stable within 6 weeks).
58-
- **Nightly**: follows the `master` branch of the repo.
58+
- **Nightly**: follows the `main` branch of the repo.
5959
This is the only channel where unstable features are intended to be used,
6060
which happens via opt-in feature gates.
6161

@@ -97,7 +97,7 @@ before approving).
9797
This is yet another bot that will compile a collection of
9898
benchmarks on a compiler with your changes.
9999
The numbers are reported
100-
[here][perf], and you can see a comparison of your changes against the latest master.
100+
[here][perf], and you can see a comparison of your changes against the latest main.
101101

102102
> For an introduction to the performance of Rust code in general
103103
> which would also be useful in rustc development, see [The Rust Performance Book].
@@ -153,7 +153,7 @@ We have [a chapter](git.md) on how to use Git when contributing to Rust.
153153

154154
### Keeping your branch up-to-date
155155

156-
The CI in rust-lang/rust applies your patches directly against the current master,
156+
The CI in rust-lang/rust applies your patches directly against the current `main` branch,
157157
not against the commit your branch is based on.
158158
This can lead to unexpected failures
159159
if your branch is outdated, even when there are no explicit merge conflicts.
@@ -164,7 +164,7 @@ During review, make incremental commits to address feedback.
164164
Prefer to squash or rebase only at the end, or when a reviewer requests it.
165165

166166
When updating, use `git push --force-with-lease` and leave a brief comment explaining what changed.
167-
Some repos prefer merging from `upstream/master` instead of rebasing;
167+
Some repos prefer merging from `upstream/main` instead of rebasing;
168168
follow the project's conventions.
169169
See [keeping things up to date](git.md#keeping-things-up-to-date) for detailed instructions.
170170

@@ -264,7 +264,7 @@ It will look something like this:
264264
This tells [@bors], our lovable integration bot, that your pull request has been approved.
265265
The PR then enters the [merge queue], where [@bors]
266266
will run *all* the tests on *every* platform we support.
267-
If it all works out, [@bors] will merge your code into `master` and close the pull request.
267+
If it all works out, [@bors] will merge your code into `main` and close the pull request.
268268

269269
Depending on the scale of the change, you may see a slightly different form of `r+`:
270270

@@ -288,7 +288,7 @@ You are now ready to file a pull request (PR)?
288288
Great!
289289
Here are a few points you should be aware of.
290290

291-
All pull requests should be filed against the `master` branch,
291+
All pull requests should be filed against the `main` branch,
292292
unless you know for sure that you should target a different branch.
293293

294294
Run some style checks before you submit the PR:
@@ -303,7 +303,7 @@ Rust follows a _no merge-commit policy_,
303303
meaning that when you encounter merge conflicts,
304304
you are expected to always rebase instead of merging.
305305
For example,
306-
always use rebase when bringing the latest changes from the master branch to your feature branch.
306+
always use rebase when bringing the latest changes from the main branch to your feature branch.
307307
If your PR contains merge commits, it will get marked as `has-merge-commits`.
308308
Once you have removed the merge commits, e.g., through an interactive rebase, you
309309
should remove the label again:
@@ -328,7 +328,7 @@ the issue in question.
328328
However, if your PR fixes a stable-to-beta or stable-to-stable regression and has
329329
been accepted for a beta and/or stable backport (i.e., it is marked `beta-accepted`
330330
and/or `stable-accepted`), please do *not* use any such keywords since we don't
331-
want the corresponding issue to get auto-closed once the fix lands on master.
331+
want the corresponding issue to get auto-closed once the fix lands on `main`.
332332
Please update the PR description while still mentioning the issue somewhere.
333333
For example, you could write `Fixes (after beta backport) #NNN.`.
334334

src/conventions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ individually using `./x fmt`.
165165

166166
**No merges.** We do not allow merge commits into our history, other
167167
than those by bors. If you get a merge conflict, rebase instead via a
168-
command like `git rebase -i rust-lang/master` (presuming you use the
168+
command like `git rebase --interactive rust-lang/main` (presuming you use the
169169
name `rust-lang` for your remote).
170170

171171
**Individual commits do not have to build (but it's nice).** We do not

src/external-repos.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ A `subtree pull` takes all changes since the last `subtree pull`
114114
from the tool repo and adds these commits to the rustc repo along with a merge commit that moves
115115
the tool changes into the specified directory in the Rust repository.
116116
117-
It is recommended that you always do a push first and get that merged to the tool master branch.
117+
It is recommended that you always do a push first and get that merged to the default branch of the tool.
118118
Then, when you do a pull, the merge works without conflicts.
119119
While it's definitely possible to resolve conflicts during a pull, you may have to redo the conflict
120120
resolution if your PR doesn't get merged fast enough and there are new conflicts. Do not try to
@@ -163,7 +163,7 @@ More information may be found on the Forge [Toolstate chapter].
163163
In practice, it is very rare for documentation to have broken toolstate.
164164
165165
Breakage is not allowed in the beta and stable channels, and must be addressed
166-
before the PR is merged. They are also not allowed to be broken on master in
166+
before the PR is merged. They are also not allowed to be broken on main in
167167
the week leading up to the beta cut.
168168
169169
[git submodules]: https://git-scm.com/book/en/v2/Git-Tools-Submodules

src/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ You can find the list of such PRs [here][abandoned-prs].
140140
If the PR has been implemented in some other way in the meantime, the `S-inactive` label
141141
should be removed from it.
142142
If not, and it seems that there is still interest in the change,
143-
you can try to rebase the pull request on top of the latest `master` branch and send a new
143+
you can try to rebase the pull request on top of the latest `main` branch and send a new
144144
pull request, continuing the work on the feature.
145145

146146
[abandoned-prs]: https://github.com/rust-lang/rust/pulls?q=is%3Apr+label%3AS-inactive+is%3Aclosed

src/git.md

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ useful when contributing to other repositories in the Rust project.
5757
Below is the normal procedure that you're likely to use for most minor changes
5858
and PRs:
5959

60-
1. Ensure that you're making your changes on top of master:
61-
`git checkout master`.
62-
2. Get the latest changes from the Rust repo: `git pull upstream master --ff-only`.
60+
1. Ensure that you're making your changes on top of main:
61+
`git checkout main`.
62+
2. Get the latest changes from the Rust repo: `git pull upstream main --ff-only`.
6363
(see [No-Merge Policy][no-merge-policy] for more info about this).
6464
3. Make a new branch for your change: `git checkout -b issue-12345-fix`.
6565
4. Make some changes to the repo and test them.
@@ -72,7 +72,7 @@ and PRs:
7272
6. Push your changes to your fork: `git push --set-upstream origin issue-12345-fix`
7373
(After adding commits, you can use `git push` and after rebasing or
7474
pulling-and-rebasing, you can use `git push --force-with-lease`).
75-
7. [Open a PR][ghpullrequest] from your fork to `rust-lang/rust`'s master branch.
75+
7. [Open a PR][ghpullrequest] from your fork to `rust-lang/rust`'s main branch.
7676

7777
[ghpullrequest]: https://guides.github.com/activities/forking/#making-a-pull-request
7878

@@ -101,7 +101,7 @@ Here are some common issues you might run into:
101101

102102
Git has two ways to update your branch with the newest changes: merging and rebasing.
103103
Rust [uses rebasing][no-merge-policy]. If you make a merge commit, it's not too hard to fix:
104-
`git rebase -i upstream/master`.
104+
`git rebase -i upstream/main`.
105105

106106
See [Rebasing](#rebasing) for more about rebasing.
107107

@@ -151,7 +151,7 @@ replace `src/tools/cargo` with the path to that submodule):
151151
- If you modified the submodule in several different commits, you will need to repeat steps 1-3
152152
for each commit you modified. You'll know when to stop when the `git log` command shows a commit
153153
that's not authored by you.
154-
5. Squash your changes into the existing commits: `git rebase --autosquash -i upstream/master`
154+
5. Squash your changes into the existing commits: `git rebase --autosquash -i upstream/main`
155155
6. [Push your changes](#standard-process).
156156

157157
### I see "error: cannot rebase" when I try to rebase
@@ -197,7 +197,7 @@ and just want to get a clean copy of the repository back, you can use `git reset
197197

198198
```console
199199
# WARNING: this throws out any local changes you've made! Consider resolving the conflicts instead.
200-
git reset --hard master
200+
git reset --hard main
201201
```
202202

203203
### failed to push some refs
@@ -222,12 +222,12 @@ rebase! Use `git push --force-with-lease` instead.
222222

223223
If you see many commits in your rebase list, or merge commits, or commits by other people that you
224224
didn't write, it likely means you're trying to rebase over the wrong branch. For example, you may
225-
have a `rust-lang/rust` remote `upstream`, but ran `git rebase origin/master` instead of `git rebase
226-
upstream/master`. The fix is to abort the rebase and use the correct branch instead:
225+
have a `rust-lang/rust` remote `upstream`, but ran `git rebase origin/main` instead of `git rebase
226+
upstream/main`. The fix is to abort the rebase and use the correct branch instead:
227227

228228
```console
229229
git rebase --abort
230-
git rebase -i upstream/master
230+
git rebase --interactive upstream/main
231231
```
232232

233233
<details><summary>Click here to see an example of rebasing over the wrong branch</summary>
@@ -243,8 +243,8 @@ Git says you have modified some files that you have never edited. For example,
243243
running `git status` gives you something like (note the `new commits` mention):
244244

245245
```console
246-
On branch master
247-
Your branch is up to date with 'origin/master'.
246+
On branch main
247+
Your branch is up to date with 'origin/main'.
248248

249249
Changes not staged for commit:
250250
(use "git add <file>..." to update what will be committed)
@@ -277,11 +277,11 @@ merged. To do that, you need to rebase your work on top of rust-lang/rust.
277277

278278
### Rebasing
279279

280-
To rebase your feature branch on top of the newest version of the master branch
280+
To rebase your feature branch on top of the newest version of the main branch
281281
of rust-lang/rust, checkout your branch, and then run this command:
282282

283283
```console
284-
git pull --rebase https://github.com/rust-lang/rust.git master
284+
git pull --rebase https://github.com/rust-lang/rust.git main
285285
```
286286

287287
> If you are met with the following error:
@@ -293,10 +293,10 @@ git pull --rebase https://github.com/rust-lang/rust.git master
293293
> case, run `git stash` before rebasing, and then `git stash pop` after you
294294
> have rebased and fixed all conflicts.
295295
296-
When you rebase a branch on master, all the changes on your branch are
297-
reapplied to the most recent version of master. In other words, Git tries to
298-
pretend that the changes you made to the old version of master were instead
299-
made to the new version of master. During this process, you should expect to
296+
When you rebase a branch on main, all the changes on your branch are
297+
reapplied to the most recent version of main. In other words, Git tries to
298+
pretend that the changes you made to the old version of main were instead
299+
made to the new version of main. During this process, you should expect to
300300
encounter at least one "rebase conflict." This happens when Git's attempt to
301301
reapply the changes fails because your changes conflicted with other changes
302302
that have been made. You can tell that this happened because you'll see
@@ -318,9 +318,9 @@ Your code
318318

319319
This represents the lines in the file that Git could not figure out how to
320320
rebase. The section between `<<<<<<< HEAD` and `=======` has the code from
321-
master, while the other side has your version of the code. You'll need to
321+
main, while the other side has your version of the code. You'll need to
322322
decide how to deal with the conflict. You may want to keep your changes,
323-
keep the changes on master, or combine the two.
323+
keep the changes on main, or combine the two.
324324

325325
Generally, resolving the conflict consists of two steps: First, fix the
326326
particular conflict. Edit the file to make the changes you want and remove the
@@ -343,15 +343,15 @@ guide on rebasing work and dealing with merge conflicts.
343343
Here is some general advice about how to keep your local repo
344344
up-to-date with upstream changes:
345345

346-
Using `git pull upstream master` while on your local master branch regularly
346+
Using `git pull upstream main` while on your local main branch regularly
347347
will keep it up-to-date. You will also want to keep your feature branches
348348
up-to-date as well. After pulling, you can checkout the feature branches
349349
and rebase them:
350350

351351
```console
352-
git checkout master
353-
git pull upstream master --ff-only # to make certain there are no merge commits
354-
git rebase master feature_branch
352+
git checkout main
353+
git pull upstream main --ff-only # to make certain there are no merge commits
354+
git rebase main feature_branch
355355
git push --force-with-lease # (set origin to be the same as local)
356356
```
357357

@@ -360,7 +360,7 @@ To avoid merges as per the [No-Merge Policy](#no-merge-policy), you may want to
360360
to ensure that Git doesn't create merge commits when `git pull`ing, without
361361
needing to pass `--ff-only` or `--rebase` every time.
362362

363-
You can also `git push --force-with-lease` from master to double-check that your
363+
You can also `git push --force-with-lease` from main to double-check that your
364364
feature branches are in sync with their state on the Github side.
365365

366366
## Advanced Rebasing
@@ -373,23 +373,23 @@ On the one hand, you lose track of the steps in which changes were made, but
373373
the history becomes easier to work with.
374374

375375
If there are no conflicts and you are just squashing to clean up the history,
376-
use `git rebase --interactive --keep-base master`. This keeps the fork point
376+
use `git rebase --interactive --keep-base main`. This keeps the fork point
377377
of your PR the same, making it easier to review the diff of what happened
378378
across your rebases.
379379

380380
Squashing can also be useful as part of conflict resolution.
381381
If your branch contains multiple consecutive rewrites of the same code, or if
382382
the rebase conflicts are extremely severe, you can use
383-
`git rebase --interactive master` to gain more control over the process. This
383+
`git rebase --interactive main` to gain more control over the process. This
384384
allows you to choose to skip commits, edit the commits that you do not skip,
385385
change the order in which they are applied, or "squash" them into each other.
386386

387387
Alternatively, you can sacrifice the commit history like this:
388388

389389
```console
390390
# squash all the changes into one commit so you only have to worry about conflicts once
391-
git rebase -i --keep-base master # and squash all changes along the way
392-
git rebase master
391+
git rebase --interactive --keep-base main # and squash all changes along the way
392+
git rebase main
393393
# fix all merge conflicts
394394
git rebase --continue
395395
```
@@ -402,9 +402,9 @@ because they only represent "fixups" and not real changes. For example,
402402

403403
After completing a rebase, and before pushing up your changes, you may want to
404404
review the changes between your old branch and your new one. You can do that
405-
with `git range-diff master @{upstream} HEAD`.
405+
with `git range-diff main @{upstream} HEAD`.
406406

407-
The first argument to `range-diff`, `master` in this case, is the base revision
407+
The first argument to `range-diff`, `main` in this case, is the base revision
408408
that you're comparing your old and new branch against. The second argument is
409409
the old version of your branch; in this case, `@upstream` means the version that
410410
you've pushed to GitHub, which is the same as what people will see in your pull
@@ -413,7 +413,7 @@ your branch; in this case, it is `HEAD`, which is the commit that is currently
413413
checked-out in your local repo.
414414

415415
Note that you can also use the equivalent, abbreviated form `git range-diff
416-
master @{u} HEAD`.
416+
main @{u} HEAD`.
417417

418418
Unlike in regular Git diffs, you'll see a `-` or `+` next to another `-` or `+`
419419
in the range-diff output. The marker on the left indicates a change between the
@@ -481,7 +481,7 @@ to follow and understand.
481481
### Hiding whitespace
482482

483483
Github has a button for disabling whitespace changes that may be useful.
484-
You can also use `git diff -w origin/master` to view changes locally.
484+
You can also use `git diff -w origin/main` to view changes locally.
485485

486486
![hide whitespace](./img/github-whitespace-changes.png)
487487

src/rustdoc-internals/rustdoc-gui-test-suite.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ These use a NodeJS-based tool called [`browser-UI-test`] that uses [puppeteer] t
1111
[`browser-UI-test`]: https://github.com/GuillaumeGomez/browser-UI-test/
1212
[puppeteer]: https://pptr.dev/
1313
[rustdoc-gui-readme]: https://github.com/rust-lang/rust/blob/HEAD/tests/rustdoc-gui/README.md
14-
[goml-script]: https://github.com/GuillaumeGomez/browser-UI-test/blob/master/goml-script.md
14+
[goml-script]: https://github.com/GuillaumeGomez/browser-UI-test/blob/main/goml-script.md

src/tests/adding.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Adding new tests
22

33
**In general, we expect every PR that fixes a bug in rustc to come accompanied
4-
by a regression test of some kind.** This test should fail in master but pass
4+
by a regression test of some kind.** This test should fail in `main` but pass
55
after the PR. These tests are really useful for preventing us from repeating the
66
mistakes of the past.
77

0 commit comments

Comments
 (0)