|Strategies for repairing a branch after a misguided rebase [message #1764882]
||Fri, 02 June 2017 20:18
| David M. Karr
Registered: July 2009
A week or so ago, I created a branch to work on a pull request. Today I was talking to another dev on the team to resolve a problem I was having while testing my code. He pointed out that he merged the changes I needed to master a few days ago.|
So, I made sure all the changes I had were committed to my branch, then I switched to master to do a pull, then switched back to my branch and did a "rebase to master". At that point, I was confused, because several of the files I had on my branch were now gone. I guess a rebase strategy at that point was not effective.
I then went into the reflog and checked out detached my last commit on my branch, to verify that my files were still there.
At this point, I could take the "lazy" approach of recloning my repository into a new local repo, creating a new branch, copying in the files from the original repo (now in "detached" mode), and committing and pushing those changes.
However, I'd like to see if it's possible to repair this branch back to where it was, and perhaps now do a "merge" from master to my branch instead of a rebase. It seems likely that would have been a better strategy.
What can I do at this point?
Powered by FUDForum
. Page generated in 0.01430 seconds