I have this commit that was undone by someone who doesn't know how to deal with conflicts. Is there an easy way to try auto merging the commit back in? I tried using "merge to master" but it just says up to date. I am using tortoisegit.
Asked
Active
Viewed 3.2k times
1 Answers
150
That's what git cherry-pick
is for. It lets you apply changes by using already existing commits.
The basic syntax is:
git cherry-pick <commit> ...
-
9Amazing! Of course I knew `git cherry-pick`, but I didn't think about using it in this case. Thanks! – rkallensee Apr 14 '16 at 21:58
-
For those wanting to cherry pick a particular commit, you can just do `git cherry-pick [commit number here]` – levininja Oct 23 '18 at 13:58
-
1What if that person has overwritten 4 of your commits? Can you cherry pick them as a group? – Janneman96 Oct 30 '18 at 13:34
-
3@Janneman96 AFAICT, `git cherry-pick` can accept more than one commit, but it creates a new commit for each of them. One solution to that would be to then use `git rebase -i` to combine the new commits into one. – svick Oct 31 '18 at 14:42