Wednesday, 12 November 2025

Git cherry pick

how to cherry pick codes from development to staging

  1. need to find commit hash using git log
  2. git checkout release/1-staging
  3. git checkout -b feature/SMP-7777
  4. git cherry-pick hash
  5. git push --set-upstream origin feature/SMP-7777
  6. create code review

If pick mutiple commits, start cherry pick from old one.

//example
git checkout master

git checkout -b feature/my-4247-hot-fix

git cherry-pick cd5861fb4c098855fe99b1eb74790874c6be4570 22dfcc0dd6064029da786637e3ceb3b5b5d00719

git push -u origin feature/my-4247-hot-fix

No comments:

Post a Comment