gh
gh copied to clipboard
Add support for merging PRs remotely without pulling down commits locally
I would like to see a new feature that would let you use gh
to perform a merge
of a PR remotely, by that I mean just like clicking actions in this UI below:

My idea would be to add a new flag that is -g
or --github
that would signal we are executing actions that happen remotely using github api, no commits are downloaded locally.
So in the screenshot you see we actually have 3 actions that could be performed. Here is how we could map them to gh
Just performing the default merge
operation in the UI we could do that like this:
$ gh pr 112 -g --merge
Then we could also check for other args like '--merge' or '--rebase'.
So if i wanted 'gh' to perform a 'merge' or PR 112 on github.com directly, we would say
$ gh pr 112 -g --merge
If I wanted to do a rebase and merge on github.com directly I could do
$ gh pr 112 -g --merge --rebase
If I wanted to do a 'squash and merge' it would be
$ gh pr 112 -g --merge --squash
@gamerson I was recently pondering why we currently have a gh pr --fetch 1 --merge
if all it does is merge locally.
After all this really isn't a git tool but a GitHub tool ahah.
I would like to leverage those existing commands for --merge
, --rebase
and repurpose them to merge and rebase remotely.
Actually I've never used those commands :) --fetch --merge for the pr command. Also, does github even do a remote rebase? I thought that feature was removed a long time ago.
On Sat, Jan 5, 2019 at 3:57 PM Ryan Garant [email protected] wrote:
@gamerson https://github.com/gamerson I was recently pondering why we currently have a gh pr --fetch 1 --merge if all it does is merge locally.
After all this really isn't a git tool but a GitHub tool ahah.
I would like to leverage those existing commands for --merge, --rebase and repurpose them to merge and rebase remotely.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/node-gh/gh/issues/467#issuecomment-451694169, or mute the thread https://github.com/notifications/unsubscribe-auth/AAkVFdHbZV1V_62w_GlX2cplefBTXL9qks5vAR-tgaJpZM4LuPCg .
-- Greg Amerson Liferay Developer Tools Liferay, Inc. www.liferay.com
It looks like you can squash, merge, or rebase remotely with this octokit method: https://octokit.github.io/rest.js/#api-Pulls-merge
Oh i see, rebase for the PR. I was thinking rebase (fast-forward) for a remote fork which I don't think exists anymore.
On Mon, Jan 7, 2019 at 10:01 AM Ryan Garant [email protected] wrote:
It looks like you can squash, merge, or rebase remotely with this octokit method: https://octokit.github.io/rest.js/#api-Pulls-merge
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/node-gh/gh/issues/467#issuecomment-451983628, or mute the thread https://github.com/notifications/unsubscribe-auth/AAkVFbbVNB-nfkhzYT8HDqjc2airED9nks5vA29qgaJpZM4LuPCg .
-- Greg Amerson Liferay Developer Tools Liferay, Inc. www.liferay.com