Has anyone found a way to merge changes in Xcode project or Core Data model files?

﹥>﹥吖頭↗ 提交于 2019-12-13 15:41:49

问题


Is there a way to use a VCS (I'm using git) and have it work with merges to the Xcode files? For example, if my co-worker adds a new Group to the project, when I merge in his changes, I get the Group merged in?

Or if he adds an attr to a Core Data entity, I get that attr in my Core Data model?


回答1:


Core Data and nib files don't merge well.

Xcode project (project.pbxproj) files generally do, with one exception: when two team members both add files to the same project group. Then they both tend to collate on the same line in the project file and cause a conflict. In the vast majority of cases, accepting both edits one after the other (order is irrelevant) results in a successfully merged file.




回答2:


The easiest solution to merging the pbxproj file is using Xcode's FileMerge Utility as described here:

https://stackoverflow.com/a/15668666/307217

Basically FileMerge already knows how to do it for you, so celebrate :) You don't even need to select which parts to merge, it already knows. I would assume since the pbxproj file is always such a huge problem, but FileMerge knows how to merge it, the same will most likely apply to Core Data and xib files as well. Although I have never personally ran into that issue.



来源:https://stackoverflow.com/questions/1792174/has-anyone-found-a-way-to-merge-changes-in-xcode-project-or-core-data-model-file

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