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

為{幸葍}努か 提交于 2019-12-05 22:18:21

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.

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.

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.

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

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

Goto Finder, open that Info.plist file in TextEdit. You'll see line like this

<<<<<<< HEAD
    <string>322</string>
=======
    <string>402</string>
>>>>>>> branch

Remove any of unwanted lines. Open Xcode again, this time it will open normally without showing Xcode saying the file is not proper format.

appx: unwanted lines may be

<<<<<<< HEAD
    <string>322</string>
=======

or

=======
    <string>402</string>
>>>>>>> branch
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!