Reprint: http://blog.csdn.net/hudashi/article/details/7669462
git cherry-pick is used to apply commit modifications from another local branch to the current branch.
Practical Issues a commit (38361a68138140827b31b72f8bbfd88b3705d77a) was made on the local master branch , and how to put it on the local O On the LD_CC branch? One way: Use cherry-pick. According to the GIT documentation: Apply The changes introduced by some existing commitsis to apply the existing commit (which is understood to be resubmitted)
Simple usage :git cherry-pick <commit id>For example:$ git checkout old_cc$ git cherry-pick 38361a68 1. If it goes well, it will be submitted normally. Results:finished one cherry-pick.# on Branch old_cc# Your Branch is ahead of ' ORIGIN/OLD_CC ' by 3 commits.2. If there is a conflict in the process of Cherry-pickAutomatic Cherry-pick failed. After resolving the conflicts,mark the corrected paths with ' git add <paths> ' or ' git rm <paths> 'and commit the result with:
git commit-c 15a2b6c61927e5aed6718de89ad9dafba939a90b
as with ordinary conflicts, manual resolution:execute git status to see which files conflict$ git statusboth modified:app/models/user.rbThen manually resolve the conflicting files, then change to add to the index via git add, and finally execute the GIT commit commit modification. $ vim app/models/user.rb$ git add app/models/user.rbgit commit-c < original commit number >
Git cherry-pick Introduction