1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
//Cherry pick use for getting any commit which is you want to own it in your working branch. //For instance Staging branch has committed item (A,B,C,D), when you are in another branch and just cherry-pick the commit B from Staging branch, your current branch will just merge with that commit only, so the commit A,C,D will just ignore from the process. //Let Start //I am working on `master` branch right now. //Ray updated the program file at `develop` branch there is 10 committed item on git //and now I have to get the second last commit change to add into `master` branch only. //So I will do it like, git fetch git checkout master git cherry-pick COMMIT-HASH-OF-THE-SECOND-LAST-COMMIT git push origin master/git push //DONE, then the other 9 commit will just be ignored. we only pick the second last content change. //Cheers |