I’m hacking on a GitHub-based project and I’m putting each new feature in a separate branch. I started from the upstream master branch and made some changes in a branch feature1. The problem is that I forgot to switch back to master before implementing feature2, so my tree looks like this:
* 4a0d1ef - Added feature 3 (HEAD, feature3)
| * 685534d - Finished feature 2 (feature2)
| * ef31e06 - Started feature 2
| * cd2ebe3 - Finished feature 1 (feature1)
| * dbd1041 - Started feature 1
|/
* 9bfffc2 - Latest upstream change (origin/master, origin/HEAD, master)
(I implemented a third feature, and that time I remembered to make my changes against master.) I have already submitted all three features as separate pull requests, so I don’t think rebasing is possible. Is there any way to change the feature2 branch so that it’s based on master instead of the feature1 branch?
masteris the new baseline,feature1is the old baseline, andfeature2is the branch you’re changing.If your pull request has already been accepted, there’s not much you can do. Otherwise, do the rebase and do a new pull request.