So I forked an open source project, and sent in a bugfix last week that was not pulled into their master. I created that fix on a separate branch, rebased it on top of upstream’s master, and issued a pull request from that branch. However, I then began work on a new issue, but mistakenly created this new issue’s branch off of the branch I created for the original bugfix.
So now I have that commit directly below mine in the branch I’d like to push up and issue a pull request to. I fetched and merged all updates to upstream/master into my master branch, and I’d like to rebase this new commit on top and send it up, but due to that older bugfix commit, trying to rebase creates a conflict.
What is the best way to deal with this?
(As stated in my comment, ) The solution would be to soft reset the commit (
git reset --soft HEAD^), stash it withgit stash saveand then switch to the correctHEADviarebase,checkoutor whichever way you prefer or have to use.After this, a simple
git stash applyshould recover your work from the stash.