Need one commit from another branch but not all changes? Cherry-pick copies specific commits.
Pick Single Commit:
# Find commit hash you want git log feature-branch --oneline # abc1234 Fix critical bug # Switch to target branch git checkout main # Cherry-pick that commit git cherry-pick abc1234 # Commit is now in main branch!
Pick Multiple Commits:
git cherry-pick abc1234 def5678 ghi9012
Pick Range:
git cherry-pick abc1234..ghi9012
Resolve Conflicts: If conflicts, fix them, then: git cherry-pick –continue
