git - Pull a commit into another branch exactly (without merging) -
i have structure similar below:
c1 -- c2 -- c3 \ -- c4
i want pull c3
on on top of c4
. (nb: c3
& c3a
hold save files)
c1 -- c2 -- c3 \ -- c4 -- c3a
if try merge or pull told date.
how can force 're-merge' can c3
on top?
in current branch, don't think can since c3 merged in branch.
you can try cherry-picking commits on new branch though, should give desired results:
first, create new branch:
git checkout -b new_branch <c1>
now cherry pick c4 on new_branch:
git cherry-pick c4
now cherry pick c# on new_branch:
git cherry-pick c3
the above should give desired results in new_branch
:
c1 -- c2 -- c3 \-- c4 -- c3
Comments
Post a Comment