Overriding alternative to cherry-pick

微笑、不失礼 提交于 2019-12-06 06:47:00

You could use the merge strategy option 'theirs':

git cherry-pick <SHA-1> -Xtheirs

Where <SHA-1> is the hash of the commit you want to cherry pick into your branch.

This means that, in case of conflict, Git would always resolve it with the version of commit being cherry-picked ("theirs").


Note that, even without that option, you can do the same manually (but that would not scale well with many files)

git cherry-pick <SHA-1>
error: could not apply <SHA-1>... [Commit Message]
hint: after resolving the conflicts, mark the corrected paths

git checkout --theirs path/to/conflicted_file.php
git add path/to/conflicted_file.php
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!