I switch to a branch (branch1) in git and I did multiple commits there in that branch. And now I switch to another branch (branch2), how can I merge 1 (the latest in branch1) to this new branch (branch2)?
If I do 'git merge branch1' when I am in branch2, i will merge all commits I did in branch1. I do not want that i only want the latest one.
Thank you.
You want:
$ git cherry-pick COMMITID
See the git cherry_pick
man page:
Given one or more existing commits, apply the change each one introduces, recording a new commit for each.
This requires your working tree to be clean (no modifications from theHEAD
commit).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With