rebase - How to linearize "splintered" merging history in Git? -
it must obvious, found no way it. every manual describes rebasing onto top of existing branch or simple interactive rebase , that's all. suppose, have diamond-shaped git history that:
* 949430f merge commit (d) (head, mybranch) |\ | * e6a2e8b (c) * | 3e653ff (b) |/ * 9c3641f base commit (a)
and want archieve history like:
* 949430f combined commit (bcd) | * 9c3641f base commit (a)
commits b , c may melted or discarded @ all, doesn't matter, want preserve result. not want revert commits because of nasty conficts resolving.
here things i've tried:
1) can't archeve simple squashing b , c
git rebase -i head~2 ... p 3e653ff (b) f e6a2e8b (c) ... not apply a91f3a4
well, that's understandable, there're conflicts.
2) can't archeve squashing.
git rebase -i -p head~3 ... pick 9c3641f base commit (a) f 3e653ff (b) f e6a2e8b (c) pick 949430f merge commit (d) ... error: unable match a91f3a4...
3) can't discard b , c
git rebase -i -p -m head~3 ... pick 9c3641f base commit (a) #pick 3e653ff (b) #pick e6a2e8b (c) pick 949430f merge commit (d) ... error: commit 949430f merged option -m not set. fatal: cherry-pick failed not pick 4f3e6231b5cecf57434613ca3afd2a21ba375eb9
why? here option "-m"...
does know how solve problem?
what want git reset --soft
(plus a commit noted aragaer). despite different circumstances in question, see this answer vonc.
Comments
Post a Comment