@@ -287,11 +287,11 @@ in the form:
287
287
288
288
* ` GIT_REMOTE_REF ` : Change to the remote portion of git refspec.
289
289
To specify the branch this way, ` refs/heads/BRANCH ` is used
290
- (e.g. for ` master ` -> ` refs/heads/master ` ).
290
+ (e.g. for ` main ` -> ` refs/heads/main ` ).
291
291
For pull requests, it will look like ` refs/pull/PR_NUMBER/head `
292
292
(e.g. for pull request #42 -> ` refs/pull/42/head ` ).
293
- * ` REBASE_ONTO ` : Change that to ` origin/master ` so the pull request gets rebased
294
- onto master . This can especially be important for pull requests that have been
293
+ * ` REBASE_ONTO ` : Change that to ` origin/main ` so the pull request gets rebased
294
+ onto ` main ` . This can especially be important for pull requests that have been
295
295
open a while.
296
296
297
297
Look at the list of jobs on the left hand side under "Build History" and copy
@@ -337,7 +337,7 @@ For undocumented APIs that are public, open a pull request documenting the API.
337
337
### Breaking changes
338
338
339
339
At least two TSC members must approve backward-incompatible changes to the
340
- master branch.
340
+ ` main ` branch.
341
341
342
342
Examples of breaking changes include:
343
343
@@ -373,7 +373,7 @@ providing a Public API in such cases.
373
373
#### Unintended breaking changes
374
374
375
375
Sometimes, a change intended to be non-breaking turns out to be a breaking
376
- change. If such a change lands on the master branch, a collaborator can revert
376
+ change. If such a change lands on the ` main ` branch, a collaborator can revert
377
377
it. As an alternative to reverting, the TSC can apply the semver-major label
378
378
after-the-fact.
379
379
@@ -462,7 +462,7 @@ duration.
462
462
463
463
Communicate pending deprecations and associated mitigations with the ecosystem
464
464
as soon as possible. If possible, do it before the pull request adding the
465
- deprecation lands on the master branch.
465
+ deprecation lands on the ` main ` branch.
466
466
467
467
Use the ` notable-change ` label on pull requests that add or change the
468
468
deprecation level of an API.
@@ -554,15 +554,15 @@ $ git rebase --abort
554
554
Checkout proper target branch:
555
555
556
556
``` text
557
- $ git checkout master
557
+ $ git checkout main
558
558
```
559
559
560
560
Update the tree (assumes your repository is set up as detailed in
561
561
[ CONTRIBUTING.md] ( ./pull-requests.md#step-1-fork ) ):
562
562
563
563
``` text
564
564
$ git fetch upstream
565
- $ git merge --ff-only upstream/master
565
+ $ git merge --ff-only upstream/main
566
566
```
567
567
568
568
Apply external patches:
@@ -588,19 +588,19 @@ has landed since the CI run. You will have to ask the author to rebase.
588
588
Check and re-review the changes:
589
589
590
590
``` text
591
- $ git diff upstream/master
591
+ $ git diff upstream/main
592
592
```
593
593
594
594
Check the number of commits and commit messages:
595
595
596
596
``` text
597
- $ git log upstream/master ...master
597
+ $ git log upstream/main ...main
598
598
```
599
599
600
600
Squash commits and add metadata:
601
601
602
602
``` text
603
- $ git rebase -i upstream/master
603
+ $ git rebase -i upstream/main
604
604
```
605
605
606
606
This will open a screen like this (in the default shell editor):
@@ -670,19 +670,19 @@ for that commit. This is an opportunity to fix commit messages.
670
670
pull request.
671
671
* Protects against the assumption that GitHub will be around forever.
672
672
673
- Other changes might have landed on master since the successful CI run. As a
673
+ Other changes might have landed on ` main ` since the successful CI run. As a
674
674
precaution, run tests (` make -j4 test ` or ` vcbuild test ` ).
675
675
676
676
Confirm that the commit message format is correct using
677
677
[ core-validate-commit] ( https://github.com/nodejs/core-validate-commit ) .
678
678
679
679
``` text
680
- $ git rev-list upstream/master ...HEAD | xargs core-validate-commit
680
+ $ git rev-list upstream/main ...HEAD | xargs core-validate-commit
681
681
```
682
682
683
683
Optional: For your own commits, force push the amended commit to the pull
684
684
request branch. If your branch name is ` bugfix ` , then:
685
- ` git push --force-with-lease origin master :bugfix ` . Don't close the pull
685
+ ` git push --force-with-lease origin main :bugfix ` . Don't close the pull
686
686
request. It will close after you push it upstream. It will have the purple
687
687
merged status rather than the red closed status. If you close the pull request
688
688
before GitHub adjusts its status, it will show up as a 0 commit pull
@@ -693,7 +693,7 @@ the issue with the red closed status.
693
693
Time to push it:
694
694
695
695
``` text
696
- $ git push upstream master
696
+ $ git push upstream main
697
697
```
698
698
699
699
Close the pull request with a "Landed in ` <commit hash> ` " comment. Even if
@@ -705,27 +705,27 @@ more than one commit.
705
705
706
706
### Troubleshooting
707
707
708
- Sometimes, when running ` git push upstream master ` , you might get an error
708
+ Sometimes, when running ` git push upstream main ` , you might get an error
709
709
message like this:
710
710
711
711
``` console
712
712
To https://github.com/nodejs/node
713
- ! [rejected] master -> master (fetch first)
713
+ ! [rejected] main -> main (fetch first)
714
714
error: failed to push some refs to 'https://github.com/nodejs/node'
715
715
hint: Updates were rejected because the tip of your current branch is behind
716
716
hint: its remote counterpart. Integrate the remote changes (e.g.
717
717
hint: 'git pull ...') before pushing again.
718
718
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
719
719
```
720
720
721
- That means a commit has landed since your last rebase against ` upstream/master ` .
721
+ That means a commit has landed since your last rebase against ` upstream/main ` .
722
722
To fix this, pull with rebase from upstream, run the tests again, and (if the
723
723
tests pass) push again:
724
724
725
725
``` bash
726
- git pull upstream master --rebase
726
+ git pull upstream main --rebase
727
727
make -j4 test
728
- git push upstream master
728
+ git push upstream main
729
729
```
730
730
731
731
### I made a mistake
@@ -755,7 +755,7 @@ the branch.
755
755
Each LTS release has a corresponding branch (v10.x, v8.x, etc.). Each also has a
756
756
corresponding staging branch (v10.x-staging, v8.x-staging, etc.).
757
757
758
- Commits that land on master are cherry-picked to each staging branch as
758
+ Commits that land on ` main ` are cherry-picked to each staging branch as
759
759
appropriate. If a change applies only to the LTS branch, open the pull request
760
760
against the _ staging_ branch. Commits from the staging branch land on the LTS
761
761
branch only when a release is being prepared. They might land on the LTS branch
@@ -901,7 +901,7 @@ We use labels to keep track of which branches a commit should land on:
901
901
* (for example semver-minor changes that need or should go into an LTS
902
902
release)
903
903
* ` v?.x `
904
- * Automatically applied to changes that do not target ` master ` but rather the
904
+ * Automatically applied to changes that do not target ` main ` but rather the
905
905
` v?.x-staging ` branch
906
906
907
907
Once a release line enters maintenance mode, the corresponding labels do not
0 commit comments