As a maintainer of an OSS project I constantly find myself having to fix up incoming PRs. I enjoy using the GitHub CLI, but unfortunately this CLI does not provide an easy way to identify the remote fork the PR originated from.
As a result my git remote -v
lists a lot of remotes that I had to manually add after viewing the PR in my browser to obtain the remote clone URL. This is not sustainable.
Git allows pushing to a remote URL directly, so there is no need to define the remote before hand.
This script defines a utility functions that makes it easy for gh GitHub CLI users to update contributions.
gh pr checkout 2009
# make some changes to the PR and commit them
updatePR 2009
You will see something like the following:
updatePR 2009
Pushing to git@github.com:berndverst/components-contrib.git HEAD:master
Are you sure? Type [y] to continue: y
Everything up-to-date