I have a kinda specific, complex Git situation due to mistakes I made early on and didn't address at that time. I'll first explain the steps I took (with Git network visuals) to get to where I am.
- I started with an initial
masterbranch.
- I created a
new-catalogbranch and made set of commitsA.
- I rebased
new-catalogwith outdated localmasterand pulled into the new rebasednew-catalogbranch. (Although I didn't know it at the time, this would be the start of my misery)
This created a second set of commits A' identical to A but with different commits with new timestamps.
- I created a
beta/masterbranch (still off the outdated localmaster), and PRednew-catalogintobeta/master.
- I made another set of commits
Bonbeta/master.
- I made a sub branch
beta/bootstrapoff ofbeta/master.
Now, that I am here, I want to rebase beta/master with master to prepare to PR back into master. I did try rebasing, however, I am getting some weird conflicts that I suspect is due to the duplicate set of commits A and A'. What is the safest way to rebase beta/master with master?
I have considered doing an interactive rebase and squashing/dropping the initial set of commits A, but I also don't want to lose the time information of those commits. If this is the best option, I am willing to lose the time information, but I just wanted to see if there was a better way.
In addition, if I am able to rebase beta/master successfully, do I need to rebase beta/bootstrap as well? Or will I just be able to PR into beta/master without any conflicts?
I made a git-practice repository to recreate these mistakes and this is the whole network.
Thank you so much!
https://stackoverflow.com/questions/66502211/how-to-squash-duplicate-commits-due-to-an-incorrect-rebase March 06, 2021 at 11:56AM






没有评论:
发表评论