Github


Rebasing A Pull Request on GitHub

It’s generally good practice to rebase commits on a topic branch into a single commit before merging. It results in a much cleaner commit history, and makes rollbacks easier.

The Question

However, the question was raised: what happens if you…

  • fix a bug (commit 1)
  • create a Pull Request
  • get feedback via the Pull Request
  • fix the bug fix (commit 2)
  • rebase those two commits together (new tree-ish)
  • push that back to GitHub (requires push -f )

The answer is based on understanding that a GitHub pull request has two forms of commenting: * comments on the pull request itself * comments on the commits that the pull request encapsulates. These are the comments made on specific lines in the diff.