Hacker News new | ask | show | jobs
by markov_twain 4457 days ago
Github keeps the refs for pull requests separate from branches and tags. For example, you can fetch pull request #123 into a local branch called pull-123 with: `git fetch origin refs/pull/123/head:pull-123`.

When you open a pull request from a branch, Github creates the separate pull request refs to track changes to that branch. I'm assuming they have some kind of after-receive hook that updates the ref whenever you push.

However, if you close the pull request (or delete the branch, which automatically closes the pull request), then rebase the branch locally and force push your branch, the pull request will not be updated, and you still see all the comments and historical data.

You can then open a new pull request from that branch, and go through the code review process again. If you mention #123 in the description of the new pull request, it'll create a link at the bottom of the discussion on the original, closed one. This helps keep the separate discussions tied together if you're coming back later and want to see all revisions of this branch.