isaacs / github

Just a place to track issues and feature requests that I have for github
2.21k stars 129 forks source link

Feature request for merging Pull request with "Rebase and merge using the --no-ff option" #1135

Open PeterRothman opened 7 years ago

PeterRothman commented 7 years ago

Greetings from Sweden!

Right now GitHub provides three different options for merging Pull requests - "Merge pull request", "Squash and merge" and "Rebase and merge". None of these alternatives support our needs fully. Following the concepts from Gitflow (https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow...) we want our feature branches to be merged with a separate visual track using the --no-ff option. However we want these merges to start from the top of the latest commit, e.g with an initial rebase on the develop. To achieve this we need to execute a rebase locally and then use "Merge pull request" on the Pull request on GitHub.

Instead we would very much like a fourth merging alternative on GitHub's Pull requests - "Rebase and merge" using the --no-ff option.

Best regards Peter Rothman

jd commented 6 years ago

Sounds like https://github.com/isaacs/github/issues/1143

wojtekmach commented 5 years ago

I'm very much in favour of adding a fourth option, sometimes I end up with a bunch of commits on a PR that I do want to keep but I also want the merge commit that will point to the PR that they originated from.

Perhaps the forth option could be called "Rebase and create a merge commit"? This way the whole set of options is:

waldyrious commented 4 years ago

Sounds like #1143

And #1017.

waldobronchart commented 3 years ago

For anyone watching this thread, I wrote a script to do this because I was tired of waiting on Github.

Get the script here: https://pypi.org/project/git-pr-linear-merge/

It does what the original post describes: rebase, then merge without fast-forward with a simple terminal command: git pr merge XXX

Documentation can be found on the project page.