I recently merged a pull request on GitHub with a merge commit, and it produced a merge commit as expected, but also added the commits from the branch, which we don't want. We were using the "Squash and merge" option before which only added one commit when merging the PR (as desired), but this meant it didn't appear as a merge in graphical git clients like GitKraken. A graphical representation:
How it is after merging with a merge commit:
develop ------ A ------ B ------------------------- C ----- D ----- E (merge commit)
- -
- -
feature ----- C ----- D
How I want it to be:
develop ------ A ------ B ------------------------- E (merge commit)
- -
- -
feature ----- C ----- D
Is it possible to get GitHub to only add one commit to the target branch when merging a PR and have this display as a merge in GitKraken?
See the repo for an example of what I mean. The 4 commits below the top commit were on the merged branch and shouldn't really be in develop (they correspond to C and D in the graphical example).
P.S All of the solutions from similar questions don't get the merge to appear correctly in GitKraken.