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:

  1. first, create new branch:

    git checkout -b new_branch <c1> 
  2. now cherry pick c4 on new_branch:

    git cherry-pick c4 
  3. 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

Popular posts from this blog

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -