Reputation: 17783
I'm trying to recover from massive merge/rebase havoc. In a nutshell I have a feature branch F that has some changes that must be merged into master M. But it's impossible with rebase/merge because whole F is broken (some people merged to it, others rebased it breaking Golden Rule of Rebase). So in order to merge somehow work made on F into M I decided to do cherry-picking only commits with actual work to completely new branch FEATURE-FIXED. So I did:
git pull -- on master to be sure it's updated
git checkout -b FEATURE_FIXED
git cherry-pick hash-of-commit-from-FEATURE
And now I have conflicts with every cherry pick I do. I thought that I'll simply take the content from cherry-picked commit and apply it FEATURE-FIXED without to much work - simply override files. But apparently not. Probably I don't fully understand how cherry-pick works. Why I get conflicts?
Upvotes: 0
Views: 356
Reputation: 5853
The command git cherry-pick
is just a shortcut to do a rebase of a single commit. So if the commit you are picking is causing conflicts, you'd need to resolve these just as if you were doing a (one-commit) rebase.
EDIT: It seems git cherry-pick
can be used for more than one commit. I did not use/see this before, and it seems this feature is not related to the question.
Upvotes: 1