iforvert
iforvert

Reputation: 310

How to solve git conflicts in Xcode project files (pbxproj)?

I have always solved this problem by using a merge strategy of the other members directory structure shall prevail, then confirming that there are no conflicts and mending it to what directory structure I want.

But is there another better way to resolve conflicts when merging the project.pbxproj file?

Upvotes: 19

Views: 17383

Answers (1)

Ana Llera
Ana Llera

Reputation: 1916

Normally, you simply want to accept both sides of the merge (people added different files) and that's all.

After that, if your file is still 'corrupted', in most cases the problem is due to a wrong format after merge, most common scenarios are:

  • missing a comma
  • duplicated statements

It's very easy to fix if you know what you are looking.

You can use a syntax checker to verify the project.pbxproj file, I use Kin and it works like a charm. It will parse your project configuration file and detect errors.


For Example (Using KIN)

If your project file gets corrupted you can be left with something like this:

enter image description here

And if your diffs on the file are far too much.. it can be quite challenging to find the error...now, after using KIN you can go from problem to solution in no time.

enter image description here

Upvotes: 32

Related Questions