Skip to content

Commit ffe17a8

Browse files
aduh95targos
authored andcommitted
doc: make pull-request guide default branch agnostic
Refs: #33864 PR-URL: #41299 Reviewed-By: Rich Trott <[email protected]>
1 parent c8e8fc0 commit ffe17a8

File tree

1 file changed

+27
-28
lines changed

1 file changed

+27
-28
lines changed

doc/guides/contributing/pull-requests.md

+27-28
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,17 @@ Fork the project [on GitHub](https://github.com/nodejs/node) and clone your fork
7272
locally.
7373

7474
```text
75-
$ git clone [email protected]:username/node.git
76-
$ cd node
77-
$ git remote add upstream https://github.com/nodejs/node.git
78-
$ git fetch upstream
75+
git clone [email protected]:username/node.git
76+
cd node
77+
git remote add upstream https://github.com/nodejs/node.git
78+
git fetch upstream
7979
```
8080

8181
Configure `git` so that it knows who you are:
8282

8383
```text
84-
$ git config user.name "J. Random User"
85-
$ git config user.email "[email protected]"
84+
git config user.name "J. Random User"
85+
git config user.email "[email protected]"
8686
```
8787

8888
You can use any name/email address you prefer here. We only use the
@@ -98,10 +98,10 @@ make sure this local email is also added to your
9898

9999
As a best practice to keep your development environment as organized as
100100
possible, create local branches to work within. These should also be created
101-
directly off of the `master` branch.
101+
directly off of the upstream default branch.
102102

103103
```text
104-
$ git checkout -b my-branch -t upstream/master
104+
git checkout -b my-branch -t upstream/HEAD
105105
```
106106

107107
## The process of making changes
@@ -149,8 +149,8 @@ commits any single pull request may have, and many contributors find it easier
149149
to review changes that are split across multiple commits.
150150

151151
```text
152-
$ git add my/changed/files
153-
$ git commit
152+
git add my/changed/files
153+
git commit
154154
```
155155

156156
Multiple commits often get squashed when they are landed. See the
@@ -219,12 +219,11 @@ to use `git rebase` (not `git merge`) to synchronize your work with the main
219219
repository.
220220

221221
```text
222-
$ git fetch upstream
223-
$ git rebase upstream/master
222+
git fetch upstream HEAD
223+
git rebase FETCH_HEAD
224224
```
225225

226-
This ensures that your working branch has the latest changes from `nodejs/node`
227-
master.
226+
This ensures that your working branch has the latest changes from `nodejs/node`.
228227

229228
### Step 6: Test
230229

@@ -242,7 +241,7 @@ Before submitting your changes in a pull request, always run the full Node.js
242241
test suite. To run the tests (including code linting) on Unix / macOS:
243242

244243
```text
245-
$ ./configure && make -j4 test
244+
./configure && make -j4 test
246245
```
247246

248247
And on Windows:
@@ -262,7 +261,7 @@ begin the process of opening a pull request by pushing your working branch to
262261
your fork on GitHub.
263262

264263
```text
265-
$ git push origin my-branch
264+
git push origin my-branch
266265
```
267266

268267
### Step 8: Opening the pull request
@@ -291,18 +290,18 @@ branch, add a new commit with those changes, and push those to your fork.
291290
GitHub will automatically update the pull request.
292291

293292
```text
294-
$ git add my/changed/files
295-
$ git commit
296-
$ git push origin my-branch
293+
git add my/changed/files
294+
git commit
295+
git push origin my-branch
297296
```
298297

299-
It is also frequently necessary to synchronize your pull request with other
300-
changes that have landed in `master` by using `git rebase`:
298+
If a git conflict arises, it is necessary to synchronize your branch with other
299+
changes that have landed upstream by using `git rebase`:
301300

302301
```text
303-
$ git fetch --all
304-
$ git rebase upstream/master
305-
$ git push --force-with-lease origin my-branch
302+
git fetch upstream HEAD
303+
git rebase FETCH_HEAD
304+
git push --force-with-lease origin my-branch
306305
```
307306

308307
**Important:** The `git push --force-with-lease` command is one of the few ways
@@ -349,10 +348,10 @@ your pull request waiting longer than you expect, see the
349348

350349
When a collaborator lands your pull request, they will post
351350
a comment to the pull request page mentioning the commit(s) it
352-
landed as. GitHub often shows the pull request as `Closed` at this
351+
landed as. GitHub might show the pull request as `Closed` at this
353352
point, but don't worry. If you look at the branch you raised your
354-
pull request against (probably `master`), you should see a commit with
355-
your name on it. Congratulations and thanks for your contribution!
353+
pull request against, you should see a commit with your name on it.
354+
Congratulations and thanks for your contribution!
356355

357356
## Reviewing pull requests
358357

@@ -535,7 +534,7 @@ For the size of "one logical change",
535534
[0b5191f](https://github.com/nodejs/node/commit/0b5191f15d0f311c804d542b67e2e922d98834f8)
536535
can be a good example. It touches the implementation, the documentation,
537536
and the tests, but is still one logical change. All tests should always pass
538-
when each individual commit lands on the master branch.
537+
when each individual commit lands on one of the `nodejs/node` branches.
539538

540539
### Getting approvals for your pull request
541540

0 commit comments

Comments
 (0)