I keep running into problems with git in a common workflow on GitHub.
- I fork a repo
- I commit some changes
- I make a pull request to upstream repo
- Twiddle thumbs while upstream developer sits on my pull request.
- Upstream developer makes changes to their repo
- They look at your pull request, but because of changes in their tree it will no longer apply cleanly, so they ask you to update your pull request.
- I fetch & merge changes from upstream into my repo, resolve conflicts, commit changes
- I rebase commits in my pull request to make it neat and tidy.
This is where the problem arises: my pull request now contains all the changes that occurred between steps 2 and 7, including the upstream developer's own changes. In a recent example this expanded a 10-line pull request to over 12,000 lines.
How should I reapply my original commits onto a later version of the upstream repo without their changes getting into my pull request?