Reputation: 1593
I've had a PR open for a few days that's now a little stale. I've been asked to close it, make some changes, then re-open.
I'm not sure how to do that however-- and the current pull request has about five commits to it.
Should I open a new branch, make my new modifications, then submit a PR from there? If so, how can that PR have the other five commits in it? If there are better ways to do this I'd be interested to know.
Upvotes: 8
Views: 13766
Reputation: 4479
This may tangentially help in this scenario too... After closing a Github Pull Request, without deleting its original branch, that Pull Request can later be reopened in the web UI: Just make a comment on it, and there will be a 'Reopen Pull Request' to submit that comment with.
Upvotes: 0
Reputation: 106389
A pull request is, effectively, one person requesting that their branch make their way into another branch, so you're only dealing with branches at a Git level.
At a GitHub level, you can close a PR without deleting the branch, which is likely what you want to do here.
How you proceed depends on the history you want. Note that I'm invoking these from a local Git standpoint, as the GitHub interaction we need is only really concerned with the PR.
If you want to simply continue the work you need to and reopen the PR, then do the work on that branch directly. It will still have the other commits from that branch so you don't run the risk of anything getting lost.
It also means one less branch to keep track of mentally, and one less branch to delete when all of the work is merged up. Lastly, it keeps the commit history cleaner, as there are no unnecessary merge commits lingering around.
If you want to branch off of the branch, then that's an option too - create a branch as you normally would, do your work, and then submit your PR. This branch will also have the other commits on it, so you don't run the risk of anything getting lost.
Upvotes: 7