Use git cherry pick
Last updated
Last updated
To demonstrate how to use git cherry-pick
let us assume we have a repository with the following branch state:
git cherry-pick
usage is straight forward and can be executed like:
In this example commit
Sha is a commit reference. You can find a commit reference by using git log
. In this example we have constructed lets say we wanted to use commit `f` in main
. First we ensure that we are working on the main
branch.
Then we execute the cherry-pick with the following command:
Once executed our Git history will look like:
The f commit has been successfully picked into the main branch.