I have forked a github repository, made a commit (title Some small changes), submitted a pull request and it got merged into the main repository (commit title Some small changes (#12), where #12 is the pull request number). So far, so good.
Now, when I want to update my fork (git rebase upstream/master, see here), I have this commit twice in my repository. First as Some small changes and then again as Some small changes (#12). If I create a new pull request, the Some small changes commit is again added to the pull request.
There are two ways to work around this issue:
- Clean up my fork, see this answer
- Merge all commits into one, see this answer
Both cases involve rewriting my history and having to force-push. Is there a better way to keep your fork in sync while committing pull requests?