diff --git a/contributing/workflow.md b/contributing/workflow.md index da1f53d4743c..d893c18f0fb0 100644 --- a/contributing/workflow.md +++ b/contributing/workflow.md @@ -199,6 +199,16 @@ Latest commit only: > git push --force-with-lease origin your-branch ``` +Only the specified number of commits: +```console +> git switch your-branch +> git rebase -i HEAD~3 --exec 'git commit --amend --no-edit --no-verify -S' +> git push --force-with-lease origin your-branch +``` + +> [!NOTE] +> `HEAD~3` specifies the last 3 commits in the PR. Change *3* to the actual number of commits. + All commits: ```console > git switch your-branch