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
This happens with GitHub when you squash commits merged in from the target branch.
I had been using squash and merge with Github as the default merge strategy, including merges from the target branch. This introduces a new commit and GitHub doesn't recognize that this squashed commit is the same as the ones already in master (but with different hashes). Git handles it properly but you see all the changes again in GitHub, making it annoying to review. The solution is to do a regular merge of these pulled in upstream commits instead of a squash and merge. When you want to merge in another branch into yours as a dependency, git merge --squash
and revert that single commit before pulling from master once that other branch has actually made it to master.
EDIT: another solution is to rebase and force push. Clean but rewritten history