Skip to content

Commit 4f15636

Browse files
authored
Clarify guidance around "Squash and Merge" (dotnet#20937)
* Clarify guidance around "Squash and Merge" Fixes Issue https://github.com/dotnet/corefx/issues/20841 * PR feedback. * PR feedback.
1 parent cf76f6a commit 4f15636

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

Documentation/project-docs/contributing.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,19 @@ Pull Requests
2626
* **DO** refer to any relevant issues, and include [keywords](https://help.github.com/articles/closing-issues-via-commit-messages/) that automatically close issues when the PR is merged.
2727
* **DO** tag any users that should know about and/or review the change.
2828
* **DO** ensure each commit successfully builds. The entire PR must pass all tests in the Continuous Integration (CI) system before it'll be merged.
29-
* **DO** address PR feedback in an additional commit(s) rather than ammending the existing commits, and only rebase/squash them when necessary. This makes it easier for reviewers to track changes. If necessary, squashing should be handled by the merger using the ["squash and merge"](https://github.com/blog/2141-squash-your-commits) feature, and should only be done by the contributor upon request.
29+
* **DO** address PR feedback in an additional commit(s) rather than amending the existing commits, and only rebase/squash them when necessary. This makes it easier for reviewers to track changes.
30+
* **DO** assume that ["Squash and Merge"](https://github.com/blog/2141-squash-your-commits) will be used to merge your commit unless you request otherwise in the PR.
3031
* **DO NOT** fix merge conflicts using a merge commit. Prefer `git rebase`.
3132
* **DO NOT** mix independent, unrelated changes in one PR. Separate real product/test code changes from larger code formatting/dead code removal changes. Separate unrelated fixes into separate PRs, especially if they are in different assemblies.
33+
34+
Merging Pull Requests (for contributors with write access)
35+
----------------------------------------------------------
36+
37+
* **DO** use ["Squash and Merge"](https://github.com/blog/2141-squash-your-commits) by default for individual contributions unless requested by the PR author.
38+
Do so, even if the PR contains only one commit. It creates a simpler history than "Create a Merge Commit".
39+
Reasons that PR authors may request "Merge and Commit" may include (but are not limited to):
40+
41+
- The change is easier to understand as a series of focused commits. Each commit in the series must be buildable so as not to break `git bisect`.
42+
- Contributor is using an e-mail address other than the primary GitHub address and wants that preserved in the history. Contributor must be willing to squash
43+
the commits manually before acceptance.
44+

0 commit comments

Comments
 (0)