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.
Asked
Active
Viewed 2,255 times
10
Vadim Kotov
- 8,084
- 8
- 48
- 62
okuryu
- 221
- 1
- 9
2 Answers
15
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.
VonC
- 1,262,500
- 529
- 4,410
- 5,250
-
Will this only show the key for the person merging or will it also show the original keys? – Alexis Tyler Jul 07 '18 at 04:20
-
1@AlexisTyler The merge commit should show your key (with a "verified", as shown in https://help.github.com/articles/signing-commits-using-gpg/) – VonC Jul 07 '18 at 04:24
-
all good. Just wanted to clarify for the answer since you didn't mention that. – Alexis Tyler Jul 07 '18 at 04:25
0
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.
Florent Morin
- 842
- 1
- 10
- 13