Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 10 storyboard and info.plist git diff is not properly showing

Am facing a strange issue on my Xcode 10. Whenever I get conflict on storyboard or plist, Xcode does not showing me the proper way to resolve conflicts. See the screenshot which is an example of storyboard case. If I get the conflict on plist file, then I can't even open it (Xcode saying the file is not proper format). Right now am using Xcode 9.4 to resolve this issue. Is there a way to fix it in Xcode 10. Thanks in advance.

enter image description here

like image 276
Ajumal Avatar asked Jan 01 '23 03:01

Ajumal


1 Answers

If I get the conflict on plist file, then I can't even open it (Xcode saying the file is not proper format)

Of course you can’t. Once the conflict has occurred, and the git marker text is inserted into the file, the file is not in the proper format — it is no longer a pure XML plist file.

The usual way to see the text within Xcode is to control-click on the storyboard or plist file in the navigator and choose Open As > Source Code.

enter image description here

What I personally do, however, is to open the file using BBEdit. Either way, you are now looking at the text with the git markers in it.

enter image description here

Now just edit the text directly, resolving the conflict and eliminating the markers to restore order. Now mark the merge as resolved and commit.

For example, in the above example we have this text:

<<<<<<< HEAD
    <string>3</string>
=======
    <string>2</string>
>>>>>>> branch

So we would delete the <<< line, the === line, the >>> line, and one of the remaining two lines. Now we can mark the conflict as resolved, commit, and proceed.

enter image description here

It is possible to view and compare the conflicting versions in the Xcode comparison view:

enter image description here

But I don’t think it brings you any advantage to do so.

like image 137
matt Avatar answered Jan 05 '23 02:01

matt