Is there way to squash and merge a Pull Request with my GPG signing via command line? Merging a Pull Request on UI doesn't supports GPG signing. I've tried to merge via git merge --squash, but it doesn't close the Pull Request automatically.
2 Answers
The "Squash and merge your pull request commits" is a server-side option which, indeed, does not support gpg signing.
That means you need to:
- fetch the pull request in a local clone
git merge --squash, with the--gpg-signoption- push the new merge commit
- use the GitHub API to update the Pull Request state or manually close the pull request.
It is a manual and somewhat convoluted process, but it will work.
-
Will this only show the key for the person merging or will it also show the original keys? Jul 7, 2018 at 4:20
-
1@AlexisTyler The merge commit should show your key (with a "verified", as shown in help.github.com/articles/signing-commits-using-gpg)– VonCJul 7, 2018 at 4:24
-
all good. Just wanted to clarify for the answer since you didn't mention that. Jul 7, 2018 at 4:25
You can now use hub command line tool.
The command is hub merge <url-to-pull-request>.
If you have authentication issues, you can use a developer token instead of password.