What is Git Cherry-pick?
Preethi Dovala
Vice President at JPMorgan Chase & Co. | Certified Kubernetes Application Developer(CKAD) | HashiCorp Certified Terraform Associate |Freelance Devops Instructor| AWS Certified Solutions Architect
Watch the below Video about Git Cherry-pick Commit
In Git, cherry-pick is a command that allows you to apply the changes introduced by a specific commit from one branch to another branch. It picks a single commit (or multiple specific commits) from one branch and applies it to your current working branch, without merging the entire branch history.
This is useful when you need a particular change from one branch but don't want to merge the entire branch.
Syntax
git cherry-pick <commit-hash>
<commit-hash>: The SHA hash of the commit you want to cherry-pick.
How Cherry-pick Works:
When you cherry-pick a commit, Git applies the changes made in that commit to the branch you're currently on. This creates a new commit in your current branch, containing the same changes but with a new commit hash.
Associate Consultant at Conneqt
5 个月Useful tips