[Feature Request] Semi-linear history merging strategy

Hello,

Gitlab has this very useful merging strategy for pull requests. This is an excerpt from their docs:

Semi-linear history merge requests

A merge commit is created for every merge, but the branch is only merged if a fast-forward merge is possible. This ensures that if the merge request build succeeded, the target branch build will also succeed after merging.

It would be trivial to implement: you could completely reuse your code for “rebase and then merge”, just add the --no-ff option.

Can you consider this?

Best

Marton

10 Likes

Hi @marton78,

Thanks for this feedback! We’re always working to improve GitHub and the GitHub Community Forum, and we consider every suggestion we receive. I’ve logged your feature request in our internal feature request list. Though I can’t guarantee anything or share a timeline for this, I can tell you that it’s been shared with the appropriate teams for consideration.

Cheers!

I would also very much like this, I’ve spent a few hours investigating several options, and while there are some options with GitHub Actions (namely manually rebasing a feature branch using https://github.com/marketplace/actions/automatic-rebase before merging) there is nothing to enforce that.

Therefore first class support for semi-linear PR merging would be greatly appreciated.

3 Likes

Also the fact that another Microsoft Product - Azure Repos - supports a semi-linear merging strategy (not to mention *cough* GitLab) means I’m somewhat hopeful this feature may make its way to GitHub in the not too distant future.

Ref: https://devblogs.microsoft.com/devops/pull-requests-with-rebase/

Could anyone from GitHub provide an update on this maybe? :grin:

2 Likes

This is another pain-point for us which we’re working around by manually rebasing PRs locally before merge.

I would love it if this would be actively considered for implementing, as I believe it would be very doable considering it’s already implemented in Azure Repos and GitLab.

1 Like

Chiming in to say that my team is also looking forward to having this functionality that all your competitors seem to have.