From 3a80104b29bc7496eb8a0348a6b898a1f9002706 Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Sun, 26 Dec 2021 16:52:04 -0300 Subject: [PATCH] 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 Reviewed-By: Rich Trott --- doc/guides/contributing/pull-requests.md | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/doc/guides/contributing/pull-requests.md b/doc/guides/contributing/pull-requests.md index 228b9839ca1f8b..cd2d6dcdc39c1a 100644 --- a/doc/guides/contributing/pull-requests.md +++ b/doc/guides/contributing/pull-requests.md @@ -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.