doc: remove section about amending commits in PR guide

In my first contribution, I got the amending guidance wrongly and
amended my commit to attend some requested changes.

Amending commits is never required to author a PR in the project, and
force pushing makes reviewing harder, so the PR guide should not
recommend it as a good practice.

PR-URL: https://github.com/nodejs/node/pull/41287
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
Thiago Santos 2021-12-26 16:52:04 -03:00 committed by GitHub
parent b330ab86a4
commit 94c9f62937
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -306,17 +306,10 @@ $ git push --force-with-lease origin my-branch
```
**Important:** The `git push --force-with-lease` command is one of the few ways
to delete history in `git`. Before you use it, make sure you understand the
risks. If in doubt, you can always ask for guidance in the pull request.
If you happen to make a mistake in any of your commits, do not worry. You can
amend the last commit (for example if you want to change the commit log).
```text
$ git add any/changed/files
$ git commit --amend
$ git push --force-with-lease origin my-branch
```
to delete history in `git`. It also complicates the review process, as it won't
allow reviewers to get a quick glance on what changed. Before you use it, make
sure you understand the risks. If in doubt, you can always ask for guidance in
the pull request.
There are a number of more advanced mechanisms for managing commits using
`git rebase` that can be used, but are beyond the scope of this guide.