简体   繁体   English

Xit 7中的Content.json文件中的Git,树冲突

[英]Git, tree conflict in Content.json file in Xcode 7

I have a tree conflict in Content.json files in Image.xcassets while pulling the code from another branch. 我在Image.xcassets中的Content.json文件中存在树冲突,同时从另一个分支中提取代码。 I have pretty much tried everything that I could find online but nothing helped. 我几乎尝试过我能在网上找到的所有内容,但没有任何帮助。 Apparently the conflict is in only 3 files but I am not sure which ones of all the Content.json files in the project. 显然冲突只有3个文件,但我不确定项目中所有Content.json文件中的哪些文件。

I have also tried by adding the Image.xcassets in gitignore file. 我也试过在gitignore文件中添加Image.xcassets。 But still nothing helped. 但仍然没有任何帮助。

I am a bit new to source code versioning, so please help. 我对源代码版本控制有点新,所以请帮忙。

A very late answer, but could be useful so... 答案非常晚,但可能有用......

I just had almost the same problem using Xcode 7.2. 我使用Xcode 7.2时遇到了几乎相同的问题。 For me there were two steps to resolving this issue: 对我来说,有两个步骤可以解决这个问题:

  1. Read the Xcode error message carefully to find out which Contents.json files are affected -- at the very least the message should include the names of the images affected (at least it did for me), then you can browse the Assets.xcassets folder in the Finder and locate the relevant image folders. 仔细阅读Xcode错误消息,找出哪些Contents.json文件受到影响 - 至少消息应该包含受影响的图像的名称(至少它对我有用),然后您可以浏览Assets.xcassets文件夹在Finder中找到相关的图像文件夹。 Each image folder will also contain a corresponding Contents.json file. 每个图像文件夹还将包含相应的Contents.json文件。 Remove the conflict from Contents.json files as described in 22076517 . 22076517中所述,从Contents.json文件中删除冲突。

After doing this, I found that although there were no more tree conflicts, I got a warning that a single Contents.json was still being reported as conflicted. 执行此操作后,我发现虽然没有更多的树冲突,但我收到一个警告,单个Contents.json仍然被报告为冲突。 So, on to step number 2! 所以,到第2步!

  1. Remove the offending image folder to a safe location (anything that points to that image will throw up a warning or error at this point, so try not to panic!), clean the project (not sure if this is necessary, but I find that doing this regularly lowers the chances of random, strange build errors), and then put the files back and recommit them as though you just added new files. 删除有问题的图像文件夹到一个安全的位置(指向该图像的任何东西此时都会发出警告或错误,所以尽量不要惊慌!),清理项目(不确定是否有必要,但我发现这样做会定期降低随机,奇怪的构建错误的可能性,然后将文件放回原来并重新发送它们,就好像刚刚添加了新文件一样。

And that resolved this issue! 这解决了这个问题! Good luck. 祝好运。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM