Misc #16094

Allow only "Rebase and merge" or "Squash and merge" on GitHub master branch, and sync it on update hook

Added by k0kubun (Takashi Kokubun) 12 months ago. Updated 12 months ago.




  • Our pull request merge strategy confuses contributors, as described in [Misc #16093].
  • In [Misc #16093], some committers did not like accepting a merge commit.


  • Allow using GitHub's "Rebase and merge" (suggested by marcandre (Marc-Andre Lafortune)) and "Squash and merge" (for editing a commit message as needed) to committers
    • Disable "Create a merge commit" in GitHub repository settings, to avoid concerns found in [Misc #16093].
    • Also prohibit pushes to the master branch which are not coming from a pull request by requiring CI in GitHub repository settings.
    • To allow looking up an associated GitHub pull request from git commands, add git notes to "Rebase and merge"d commits in post-receive hook. (suggested by nobu (Nobuyoshi Nakada))
  • Perform GitHub bidirectional sync on update hook, and accept a push if it does not conflict with "Rebase and merge" on GitHub.


  • Even after implementing this ticket, the Ruby's canonical Git repository will continue to be as is.
  • All committers must push non-pull-request commits to Direct pushes to GitHub will continue to be disabled.
  • This approach has one drawback; git push to might block longer than now.

Related issues

Related to Ruby master - Misc #16093: Prohibit a "foxtrot merge" instead of a merge commitRejectedActions
Related to Ruby master - Misc #14632: [ANN] git.ruby-lang.orgClosedhsbt (Hiroshi SHIBATA)Actions

Also available in: Atom PDF