doc: explain what to do if git push is rejected · nodejs/node@27b6737

@@ -512,6 +512,33 @@ your pull request shows the purple merged status then you should still

512512

add the "Landed in <commit hash>..<commit hash>" comment if you added

513513

multiple commits.

514514515+

### Troubleshooting

516+517+

Sometimes, when running `git push upstream master`, you may get an error message

518+

like this:

519+520+

```console

521+

To https://github.com/nodejs/node

522+

! [rejected] master -> master (fetch first)

523+

error: failed to push some refs to 'https://github.com/nodejs/node'

524+

hint: Updates were rejected because the remote contains work that you do

525+

hint: not have locally. This is usually caused by another repository pushing

526+

hint: to the same ref. You may want to first integrate the remote changes

527+

hint: (e.g., 'git pull ...') before pushing again.

528+

hint: See the 'Note about fast-forwards' in 'git push --help' for details.

529+

```

530+531+

That means a commit has landed since your last rebase against `upstream/master`.

532+

To fix this, fetch, rebase, run the tests again (to make sure no interactions

533+

between your changes and the new changes cause any problems), and push again:

534+535+

```sh

536+

git fetch upstream

537+

git rebase upstream/master

538+

make -j4 test

539+

git push upstream master

540+

```

541+515542

### I Just Made a Mistake

516543517544

* Ping a CTC member.