简体   繁体   中英

What does cherry-pick do?

a1----a2----a3-----a4 (branchA)
      \
       \b1---b2---b3---b4----b5----b6 (branchB)

current I am in branchA(a4) , if I do git cherry-pick b3

what happens? diff of b3 and b2 will be patched to a4?

If there are no conflicts, then the history after cherry-pick b3 will be:

a1----a2----a3-----a4----b3' (branchA)
      \
       \b1---b2---b3---b4----b5----b6 (branchB)

where b3' is the same change as b3 but rebased against branchA .

If you have any conflicts, then the cherry-pick command will tell you so and prompt you to resolve the conflicts manually before committing b3' .

In particular, doing a cherry-pick b3 does not include the changes b1 and b2 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM