-
Notifications
You must be signed in to change notification settings - Fork 0
Cherry picking a commit
Vijay Selvaraj edited this page Sep 8, 2020
·
1 revision
"git cherry-pick" helps to append an individual commit(s) from one branch into your current HEAD branch.
- Update your local repo to get latest changes from the remote repo
$ git pull origin main
- Find a commit reference
git log
- Cherry pick a commit
$ git cherry-pick <commit hash>
$ git cherry-pick 649ab0a
a - b - c (Main branch)
\
d - e (Sprint branch)
Let us consider the above example. Follow the below steps to cherry pick e from sprint branch to main.
$ git checkout main
$ git pull origin main
$ git cherry-pick e
$ git push
Now e is available in the main branch of your fork (user/rdkservices). Submit a Pull Request to upstream repository (rdkcentral/rdkservices)