-1

I would like to enforce the "rebase and merge" merge strategy for my main branch. How can I do this?

  • I use feature branches, and merge them into main, since I like the resulting "documentation" of what I have done
  • I enjoy a somewhat linear history, since this makes it easier for me to parse what happened
  • I'm working in a team of 1 (me), with changing assistants, so there are no "PR jams" or massive rebase conflicts

I searched the settings of my GitHub repository, but didn't find anything (or misunderstood them?)

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
m.reiter
  • 1,796
  • 2
  • 11
  • 31
  • 3
    https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/configuring-commit-rebasing-for-pull-requests – Ôrel Aug 28 '23 at 06:57
  • [Similar question](https://stackoverflow.com/q/44500174/1725151) although not for GitHub. – Guildenstern Aug 28 '23 at 07:41
  • 1
    I don't think rebase and merge achieves this goal: "I use feature branches, and merge them into main, since I like the resulting "documentation" of what I have done". Typically that "documentation" would need a merge commit, but in GH it's fast forward. – TTT Aug 29 '23 at 04:32
  • Sorry if this is unclear, but yes, i do NOT want to have fast-forward-rebasing. (@jonrsharpe could you please undo your edit, to re-include the images? This was much clearer originally) – m.reiter Aug 29 '23 at 06:56
  • TTT is correct, what you pictured was _not_ what "rebase and merge" does on GitHub: [_"all commits from the topic branch (or head branch) are added onto the base branch individually without a merge commit."_](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/about-pull-request-merges#rebase-and-merge-your-commits) But as a team of 1, just use git however you want to; why even PR. – jonrsharpe Aug 29 '23 at 07:05

0 Answers0