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)
We would like to know how to avoid this behaviour?
The current branch is indicated by the leading “*": If you want to switch between branches from within Xcode you can do that from the Organizer using the appropriately named “Switch Branch” icon in the bottom right corner (again ensure you have the project directory selected in the left-hand pane and not the Branches or Remotes folders):
Tab key inserts tab, not spaces is unchecked, and Tab width = 4, and Indent width = 4. However, typing a tab does not seem to result in 4 spaces. If I open a *.cpp or *.h file with an internet browser, what appeared nicely aligned in XCode, is now displayed with ragged indentation.
The easiest way to do it in Xcode is to select a code block and then hit ⌘ + [ [ and then ⌘ + ]] for each tab space. Check 'Tab key inserts tab, not spaces'.
Since Xcode has the ability to manage Git branches I thought I would take a look and share my experiences in this post. For the purposes of this post I am going to use my CodeExamples repository and create a new branch to experiment with converting one of the example projects to ARC.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With