1

Is it possible to configure GitHub to rebase PRs onto the receiving branch but without squashing? The only options I see are a merge, or a squash and a merge (or perhaps it's a squash and a rebase, unclear from the docs) -- and neither of those is what I want.

I basically want a linear history when a PR is applied but preserving all the commits from the PR.

Creos
  • 2,445
  • 3
  • 27
  • 45

1 Answers1

1

No: the documentation does mention

Pull requests are merged using the --no-ff option, except for pull requests with squashed commits, which are merged using the fast-forward option.

That being said, that means it is not possible from the GitHub web GUI.

But you could fetch a pull request locally (as in here or in this blog post), merge it to master (this time, merged by default in a fast-forward manner, if the PR branch has been done on top of upstream/master), and push master back.

The PR can then be considered as merged.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • ah so disappointing because it means the PR won't be "officially" merged as far as the web client is concerned, correct? – Creos Jul 30 '16 at 20:01
  • @Creos Yes, that is correct, and that is the drawback for this approach. – VonC Jul 30 '16 at 20:16
  • thanks, i honestly find it kind of shocking this feature does not exist (given how trivial it is to do this using native git commands), would imagine it would be very useful (perhaps not on larger teams, but smaller teams could definitely get away with rebasing since master won't change as often) – Creos Jul 30 '16 at 20:21
  • @Creos I agree. I suspect the all no-ff approach is the one seen most often for maintainer. git/git itself does it all the time (https://github.com/git/git), and build its release notes directly from those merge commits. – VonC Jul 30 '16 at 20:23