skip to content
Ivan's wiki
Site Tools
Search
Tools
Show pagesource
Backlinks
Recent Changes
Media Manager
Sitemap
>
Recent Changes
Media Manager
Sitemap
git-cherry-pick
This page is read only. You can view the source, but not change it.
# Git cherry-picking **Cherry-picking** applies a single commit from one branch to another. Instead of merging an entire branch, you select specific commits and replay them. This is useful for backporting bug fixes to an older release branch or copying a specific change without merging everything else the branch contains. Run `git cherry-pick <hash>` to apply a commit on top of your current branch. Git replays the changes from that commit and creates a new commit with the same message and author. If there are conflicts, resolve them like in a merge and run `git cherry-pick --continue`. If something goes wrong, `git cherry-pick --abort` cancels the operation. ```bash $ git cherry-pick <hash> # apply a single commit $ git cherry-pick <hash1> <hash2> # apply multiple commits $ git cherry-pick --continue # resume after resolving conflicts $ git cherry-pick --abort # cancel a cherry-pick ``` Cherry-picking creates a new commit with a different hash, so the original commit and the cherry-picked copy are separate in history. This is fine for isolated bug fixes, but for merging entire features, always use `git merge` instead—it preserves the relationship between branches and makes history easier to follow.
Page Tools
Show pagesource
Backlinks
Back to top