简体   繁体   English

分支合并后,xcode用空格替换制表符

[英]xcode replaces tabs by spaces after a branch merge

After a merge of two branches, and resolving conflicts, Xcode modifies two files: the .plist and the .pbxproj of the project. 在合并了两个分支并解决冲突之后,Xcode修改了两个文件:.plist和项目的.pbxproj。 In both cases, the leading tabs of every line are replaced by spaces . 在这两种情况下, 每行前导选项卡都用空格替换

Also after finishing the merge and creating the corresponding commit, Xcode leaves all the files that had conflicts without adding them to the commit, forcing us to make a second commit with the resolved files (including .plist and .pbxproj). 此外,在完成合并并创建相应的提交后,Xcode会保留所有冲突的文件,而不会将它们添加到提交中,从而迫使我们使用已解析的文件(包括.plist和.pbxproj)进行第二次提交。 Only happens with those two files and only if they have conflicts on the merge, other file types (.h, .m) not affected. 只有这两个文件才会发生,并且只有当它们在合并上有冲突时,其他文件类型(.h,.m)才会受到影响。

Xcode Version 9.2 (9C40b) Xcode版本9.2(9C40b)

  • The number of spaces added, corresponds to the number of tabs present: 4 spaces per tab. 添加的空格数对应于存在的选项卡数:每个选项卡4个空格。
  • In the Xcode Preferences, all the team have selected "Spaces" in "Prefer indent using: under Indentation. 在Xcode首选项中,所有团队都在“首选缩进使用:缩进下”中选择了“空格”。

We would like to know how to avoid this behaviour? 我们想知道如何避免这种行为?

Maybe it's because of indentation settings in one of the systems your team use: 也许是因为您的团队使用的某个系统中的缩进设置:

在此输入图像描述

If you have swift lint in your project, that's can cause it too. 如果您的项目中有快速的棉绒,那也可能导致它。

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

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