二进制文件的 Git pull 总是出错

二进制文件的 Git pull 总是出错

我完成了git push对 Bitbucket 存储库的访问,并在 Bitbucket 帐户中发现这些更新已完成。但是当我git pull在生产 CentOS 服务器中执行此操作时,出现以下错误。有谁知道原因以及如何解决?

xxxx@VM02 sha-ferrero-kinder_201661]$ sudo git pull
[sudo] password for XXXX:
Password:

**warning: Cannot merge binary files: images/Win/WinDisney.png (HEAD vs. 80e984389135a54b8062497fb5c202efcc89fc57)
Auto-merging images/Win/WinDisney.png
CONFLICT (add/add): Merge conflict in images/Win/WinDisney.png
Automatic merge failed; fix conflicts and then commit the result.**

详情见附件:

在此输入图像描述

答案1

工作副本中的文件仍然是当前分支的副本 - 换句话说,它没有被合并尝试修改。要解决冲突并保留此文件:

$ git add WinDisney.png 
$ git commit –m “My commit message for the merge”

如果您希望使用他们的副本解决冲突,则需要从您尝试合并的分支中获取文件的版本:

$ git checkout --theirs -- WinDisney.png

或者您可以尝试:

git mergetool

它会打开一个 GUI,引导您解决每个冲突,然后您可以选择如何合并。有时事后需要进行一些手动编辑,但通常本身就足够了。这肯定比手工完成整个事情要好得多。

(注意:git mergetool除非您安装了 GUI,否则不一定会打开 GUI。

相关内容