gpt4 book ai didi

objective-c - 我应该使用 merge=union 将 .pbxproj 文件与 git merge 吗?

转载 作者:IT王子 更新时间:2023-10-29 01:19:14 33 4
gpt4 key购买 nike

我想知道 .gitattributes 中的 merge=union 选项是否对 .pbxproj 文件有意义。

此选项的联机帮助页说明:

Run 3-way file level merge for text files, but take lines from both versions, instead of leaving conflict markers. This tends to leave the added lines in the resulting file in random order and the user should verify the result.

通常,这对于向项目添加文件的 90% 情况应该没问题。有人有这方面的经验吗?

最佳答案

不是直接体验,但是:

  • SO question真的建议再次 merge .pbxproj 文件。

The pbxproj file isn't really human mergable.
While it is plain ASCII text, it's a form of JSON. Essentially you want to treat it as a binary file.

(因此是 gitignore solution )

实际上,Peter Hosey在评论中添加:

It's a property list, not JSON. Same ideas, different syntax.

The truth is that it's way more harmful to disallow merging of that .pbxproj file than it is helpful.
The .pbxproj file is simply JSON (similar to XML). From experience, just about the ONLY merge conflict you were ever get is if two people have added files at the same time. The solution in 99% of the merge conflict cases is to keep both sides of the merge.

因此 merge “联合”(带有 gitattributes merge directive )是有意义的,但是做一些测试看看它是否与上一个问题中提到的脚本做同样的事情。

关于objective-c - 我应该使用 merge=union 将 .pbxproj 文件与 git merge 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2729109/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com