Skip to content

Commit 7c383bc

Browse files
committed
doc: update CONTRIBUTING.md to address editing PRs
Add more info about the contribution process after PR submission. PR-URL: nodejs#9259 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent 9ed7261 commit 7c383bc

File tree

1 file changed

+61
-4
lines changed

1 file changed

+61
-4
lines changed

CONTRIBUTING.md

+61-4
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,13 @@ $ git config --global user.name "J. Random User"
8989
$ git config --global user.email "[email protected]"
9090
```
9191

92+
Add and commit:
93+
94+
```text
95+
$ git add my/changed/files
96+
$ git commit
97+
```
98+
9299
Writing good commit logs is important. A commit log should describe what
93100
changed and why. Follow these guidelines when writing one:
94101

@@ -194,10 +201,60 @@ $ git push origin my-branch
194201
Go to https://github.com/yourusername/node and select your branch.
195202
Click the 'Pull Request' button and fill out the form.
196203

197-
Pull requests are usually reviewed within a few days. If there are comments
198-
to address, apply your changes in a separate commit and push that to your
199-
branch. Post a comment in the pull request afterwards; GitHub does
200-
not send out notifications when you add commits.
204+
Pull requests are usually reviewed within a few days.
205+
206+
### Step 7: Discuss and update
207+
208+
You will probably get feedback or requests for changes to your Pull Request.
209+
This is a big part of the submission process, so don't be disheartened!
210+
211+
To make changes to an existing Pull Request, make the changes to your branch.
212+
When you push that branch to your fork, GitHub will automatically update the
213+
Pull Request.
214+
215+
You can push more commits to your branch:
216+
217+
```text
218+
$ git add my/changed/files
219+
$ git commit
220+
$ git push origin my-branch
221+
```
222+
223+
Or you can rebase against master:
224+
225+
```text
226+
$ git fetch --all
227+
$ git rebase origin/master
228+
$ git push --force-with-lease origin my-branch
229+
```
230+
231+
Or you can amend the last commit (for example if you want to change the commit
232+
log).
233+
234+
```text
235+
$ git add any/changed/files
236+
$ git commit --amend
237+
$ git push --force-with-lease origin my-branch
238+
```
239+
240+
**Important:** The `git push --force-with-lease` command is one of the few ways
241+
to delete history in git. Before you use it, make sure you understand the risks.
242+
If in doubt, you can always ask for guidance in the Pull Request or on
243+
[IRC in the #node-dev channel](https://webchat.freenode.net?channels=node-dev&uio=d4).
244+
245+
Feel free to post a comment in the Pull Request to ping reviewers if you are
246+
awaiting an answer on something.
247+
248+
249+
### Step 8: Landing
250+
251+
Once your Pull Request has been reviewed and approved by at least one Node.js
252+
Collaborators (often by saying LGTM, or Looks Good To Me), and as long as
253+
there is consensus (no objections from a Collaborator), a
254+
Collaborator can merge the Pull Request . GitHub often shows the Pull Request as
255+
`Closed` at this point, but don't worry. If you look at the branch you raised
256+
your Pull Request against (probably `master`), you should see a commit with
257+
your name on it. Congratulations and thanks for your contribution!
201258

202259
<a id="developers-certificate-of-origin"></a>
203260
## Developer's Certificate of Origin 1.1

0 commit comments

Comments
 (0)