-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a gh pr update
command corresponding to the API call / button on the Web UI
#8426
Comments
And a benefit of it doing it using the GH API instead of locally is that when you do it in the GH UI, it doesn't clear your approvals, whereas if you update the branch locally and push, I'm pretty sure it does. |
Hey @tgoodsell-tempus, thanks for opening this and sorry about the slow response, December was a busy time and then we were into the holidays. We're catching up on untriaged issues at the moment. I think some of the behaviour you're describing can be emulated with The REST API equivalent to the GQL mutation would appear to be https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#update-a-pull-request-branch. We're a bit hesitant to make changes around |
@maco : it is a little nuanced as it depends on how you setup branch protection rules and/or repository rulesets
It sounds like you might have worked with some repositories that were inconsistently configured. |
We discussed this and think it would be a good command to have. To me, it feels self contained and low risk. I'd be interested in opening this up to the community to implement. WDYT @andyfeller ? |
Confirmed with Andy that we're good to let folks pick this up if they're interested! |
@williammartin @andyfeller @mxie I just pushed a PR to add the |
Describe the feature or problem you’d like to solve
The GH web interface and REST API support a PR "update" function, which does a merge or a rebase, with the rest API only supporting the merge commit option.
See: Keeping You Pull Request In Sync
It would be nice to have this function available in the CLI toolkit, meaning the direct GH API version of this, not a pseudo-update via doing the various git syncing and updating locally.
Proposed solution
Introduce a
gh pr update
command which:Additional context
As mentioned above, my personal preference is the update itself occurs using the API object, instead of doing the local only version of a merge/rebase on the base branch. Since I'm trying to mimic the Web UI button, the reasons that exists versus Github telling us to "get good" at doing branch updates I would apply to this command as well.
The text was updated successfully, but these errors were encountered: