【问题标题】:How to git cherry-pick a commit with binary files如何 git cherry-pick 带有二进制文件的提交
【发布时间】:2017-06-06 18:40:31
【问题描述】:

我正在尝试从主要是二进制文件的不同分支中挑选提交。似乎它大多是成功的,除了我收到消息的一个文件:

warning: Cannot merge binary files: XXXX.so (HEAD vs. d8ef550... Add support for 32-bit apk)
error: could not apply d8ef550... Add support for 32-bit apk
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'

我可以对该文件执行“git add”,但结果不是我所期望的。我希望它是一个修改,但结果是删除了有问题的文件。我试图挑选的提交修改了一些二进制文件并删除了一些。

所以,问题是......挑选带有二进制文件的提交的最佳方法是什么?

【问题讨论】:

    标签: git cherry-pick git-cherry-pick


    【解决方案1】:

    您可以通过git cherry-pick --strategy=recursive -X theirs {Imported_Commit} 做到这一点

    (您可能需要先中止当前的樱桃选择;git cherry-pick --abort

    【讨论】:

    • 不错。那行得通。我只需要明确地做一个'git rm '然后我就在它需要的地方。谢谢。
    猜你喜欢
    • 2018-04-17
    • 1970-01-01
    • 2012-11-05
    • 2021-01-18
    • 2012-05-21
    • 2016-10-24
    • 2016-04-11
    • 2018-04-16
    • 2016-01-08
    相关资源
    最近更新 更多