How to do the new Squash and merge
workflow with hub
? I always have the problem that I want to use my company email address when doing operations on github, that's why I cannot use the web-ui, like ever, because that always uses my primary email address. It cannot be changed.
But that is no problem, because merging works with hub. But how to do the new Squash and merge
feature? When I merge with git merge <url> --squash --no-ff
, I can create one squashed commit, but when just pushing that back to github, the PR doesn't close and registers my new commit as the squashed merged commit. Another benefit of this would be that it's possible to also gpg sign the squashed commit.
There is no built in way with hub, sorry! But there's an easy workaround: do hub merge --squash <url>
and when committing, add the phrase Closes #42
with the number of the PR that you just squashed.
Merge and squash/merge and rebase are very recent additions to GitHub web UI and I'm still figuring out how to best support their equivalents through hub. If you have any suggestions, I'm all ears!
I though you're using GitHub's API to perform most of the actions, and they do have now a parameter for the merge_method
: https://developer.github.com/v3/pulls/#merge-a-pull-request-merge-button - wouldn't that work, or am I missing something?
See the resolution in https://github.com/github/hub/issues/1483#issuecomment-457857804
Most helpful comment
I though you're using GitHub's API to perform most of the actions, and they do have now a parameter for the
merge_method
: https://developer.github.com/v3/pulls/#merge-a-pull-request-merge-button - wouldn't that work, or am I missing something?