I'm cherry picking specific commits from a release branch into my local working copy. Every time I cherry-pick a commit from the release branch I get a merge conflict which I have to resolve, even with changes that seem trivial, such as:
-const char kApplicationVersion[] = "Develop";
+const char kApplicationVersion[] = "Release";
being the only change made in the commit to main.cc.
git status
shows
You are currently cherry-picking commit 6f04be8.
(fix conflicts and run "git cherry-pick --continue")
(use "git cherry-pick --abort" to cancel the cherry-pick operation)
Unmerged paths:
(use "git add <file>..." to mark resolution)
both modified: src/appMain/main.cc
Why is there always a conflict?
Because since the two branches have diverged:
const char kApplicationVersion[] = "Develop";
const char kApplicationVersion[] = "Release";
A cherry-pick will resolve the merge against the common ancestor, but won't create an actual merge for that file (meaning the common ancestor remains a much older version, where dev
branch started from release
branch)
The next cherry-pick will consider the same old common ancestor and will trigger the same merge conflict.
See (much) more at "In a Git cherry-pick or rebase merge conflict, how are BASE (aka “the ancestor”), LOCAL, and REMOTE determined?"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With