I\'m trying to review a pull request on GitHub to a branch that isn\'t master. The target branch was behind master and the pull request showed commits from master, so I merg
To sum up, GitHub does not rebase the commit history automatically in pull requests. The simplest solutions are:
Suppose that you want to merge into master from feature-01:
git fetch origin
git checkout feature-01
git rebase origin/master
git push --force
If you are working on a fork then you might need to replace origin above with upstream. See How do I update a GitHub forked repository? to learn more about tracking remote branches of the original repository.
Suppose that you want to merge intro master from feature-01:
git checkout feature-01
git checkout -b feature-01-rebased
git push -u origin feature-01-rebased
Now open a pull request for feature-01-rebased and close the one for feature-01.