Personal workflow for handling pull requests on open-source projects
Usage: hub-pr <command> [<args>] Commands: browse Open pull request page with browser diff Show pull request's diff checkout Checkout a branch for a pull request list List pull requests merge Merge a branch of a pull request
hub-pr supports a certain way handling pull requests from forked repository. Especially, it provides a way to check out the pull request locally so that you can append commits upon it.
hub-pr checkout PULL_REQUEST_NUMBER
Will do below:
-
Add a remote pointing forked repository with the name of the pull request author
-
Check out a new branch tracking pull request’s head branch named
#<PR number>-<author>/<ref>
, e.g.#23-motemen/fix
. -
Stores the pull request number as
branch.<branch>.prNumber
into local configuration for later reference.
hub-pr merge BRANCH
Will invoke a normal git-merge with a commit message same as what will used
when hitting the Merge Button on the GitHub web. The branch must be checked out with hub-pr checkout
.
motemen <[email protected]>