简体   繁体   中英

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. 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). Only happens with those two files and only if they have conflicts on the merge, other file types (.h, .m) not affected.

Xcode Version 9.2 (9C40b)

  • The number of spaces added, corresponds to the number of tabs present: 4 spaces per tab.
  • In the Xcode Preferences, all the team have selected "Spaces" in "Prefer indent using: under Indentation.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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