In source control management, the act of selectively pulling single changes from peer to peer is called "cherry-pick".
Questions tagged [cherry-pick]
448 questions
71
votes
3 answers
How do I cherry-pick a single revision in Mercurial?
In Mercurial/TortoiseHg, given the following example, what is the easiest way to merge revision "G" into repo A without taking D,E and F (Assume that G has no dependency on D,E or F).
Repo A: A - B - C
Repo B (Clone of A) A - B - C - D - E - F -…

Tom Hubbard
- 15,820
- 14
- 59
- 86
70
votes
3 answers
Git Cherry-Pick and Conflicts
There are two different git branches. In one the development is going in (Branch1).
In other branch some PoC work is going on (Branch2). Now, I want to cherry-pick the changes from Branch1 to Branch2, so that Branch2 is up to date.
Now, after…

Kumar
- 1,536
- 2
- 23
- 33
59
votes
2 answers
Mainline parent number when cherry picking merge commits
Suppose this is my git history
Z
/
A -- C -- D
\ /
B
My HEAD is currently at Z. I want to cherry-pick B and C. If my understanding is correct, I should do this:
git cherry-pick B
git cherry-pick C -m 1
git commit --allow-empty
It…

rink.attendant.6
- 44,500
- 61
- 101
- 156
53
votes
3 answers
git apply changes from one commit onto another branch
I want to do something similar to git rebase but without collapsing parallel commits.
Let's say I have the following commits:
B (bar)
/
A-C-D (foo)
Now I want to take the changes that D introduced to C in branch foo, and apply them to B in…

juniper-
- 6,262
- 10
- 37
- 65
42
votes
6 answers
How do I split up a large Git branch into lots of smaller branches?
I have imported from SVN into Git, now I have one big branch, like this:
work on feature C
work on feature B
work on feature C
work on feature C
work on feature B
work on feature A
I want separate feature branches, for A, B, C. I'm cherry picking…

Michael Parker
- 7,180
- 7
- 30
- 39
40
votes
4 answers
Cherry pick shows no -m option was given error
I have two branch master and development
I need to get some commit id from development branch in master branch so I do it by cherry-pick but it shows me some error
$> git cherry-pick cf0d52b
error: Commit cf0d52b900f990300c3aa17936ddbae1476d461a is…

Akash Jain
- 894
- 2
- 10
- 23
38
votes
3 answers
How to cherry-pick from stash in git?
I am wondering if cherry-picking from stash is possible.
git stash save "test cherry-pick from stash"
*git cherry-pick stash@{0}* --> Is this possible?
I am getting the following exception when I tried above command:
Error:
~/Documents$ git…

would_like_to_be_anon
- 1,639
- 2
- 29
- 47
38
votes
1 answer
In a Git cherry-pick or rebase merge conflict, how are BASE (aka "the ancestor"), LOCAL, and REMOTE determined?
In a normal Git merge conflict, the three versions of a file in play for the three-way merge are roughly as follows:
LOCAL: the version from my branch
REMOTE: the version from the other branch
BASE: the version from the common ancestor of the two…

Chris
- 9,986
- 8
- 48
- 56
33
votes
4 answers
git cherry-pick to another branch
I wonder if there is the way to copy one commit to another branch without checking out that branch.
For example, I have two branches: master and parallel_version.
I'm on parallel_version branch and I found a bug in file common for these…

kassak
- 3,974
- 1
- 25
- 36
33
votes
3 answers
Undoing specific revisions in Subversion
Suppose I have a set of commits in a repository folder...
123 (250 new files, 137 changed files, 14 deleted files)
122 (150 changed files)
121 (renamed folder)
120 (90 changed files)
119 (115 changed files, 14 deleted files, 12 added files)
118 (113…

Ed Guiness
- 34,602
- 16
- 110
- 145
29
votes
3 answers
Merge tracking for Git cherry picking?
For example, I have a dev branch and a stable branch.
In case I have cherry-picked several commit from dev to stable.
Is there any way to let Git aware of the cherry-picked commits, and avoid doubly-merging it if I later merge, rebase or cherry-pick…

Adrian Shum
- 38,812
- 10
- 83
- 131
29
votes
2 answers
'Fatal: cherry-pick failed' with Git
I was working on a branch X. I made a commit and pushed it.
Then I wanted to cherry-pick it to branch Y. But due to some unmerged files present, I got the following message:
error: 'cherry-pick' is not possible because you have unmerged…

xan
- 4,640
- 13
- 50
- 83
27
votes
1 answer
TortoiseSVN cherrypicking
I'm about to merge certain revisions from trunk into a release-branch.
I've checked with mergeinfo how many revisions are eligible to get merged, and that were 42.
Although it's definitely possible and not too hard to check each revision log and…

Martin
- 1,488
- 1
- 13
- 16
26
votes
7 answers
Backport changes from renamed file
I have two branches: trunk, production. I have found a problem in trunk, made fix and committed it, pushed it. Now it was tested and I need do merge changes into the production branch as a hot-fix. I try to use the cherry-pick. However it doesn't…

kan
- 28,279
- 7
- 71
- 101
25
votes
2 answers
Why is git log --cherry-pick not removing equivalent commits?
I have been trying to use
git log --no-merges --cherry-pick --right-only master...my-branch
to generate a list of commits that are in the my-branch, but not in master (as per the git-log documentation). However, there are still many equivalent…

Wivlaro
- 1,455
- 1
- 12
- 18