I imported a Bazaar repository into Git (using git bzr
), but the resulting repository contains a spurious commit parent link:
Notice that the commit tagged 1.02-6
is based off the 1.02-3
commit, but 1.02-1
is unnecessarily also marked as a parent. (Note: All the commits in this part of the repo are tagged; there are no commits between the ones shown.)
I have tried rebasing in several ways (on the master
branch: git rebase 1.02-3
, git rebase -i upstream-1.02
, git rebase --onto 1.02-1 1.02-3
, git rebase --root upstream-1.02 --onto=other_branch
), but in each case it fails with a merge conflict. These seem to be attempting more than is necessary; the history is correct except for an extra parent pointer being recorded in the commit tagged 1.02-6
.
How do you remove the link in order to linearize the history? Is there a better way than manually cherry-picking all the commits in sequence?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…