xcode 由于与 UserInterfaceState.xcuserstate 冲突而无法合并

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13870652/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 02:18:55  来源:igfitidea点击:

Cannot Merge due to conflict with UserInterfaceState.xcuserstate

xcodecommitmerge-conflict-resolution

提问by JeffB6688

I created a branch and made a bunch of changes. I committed the changes and then archived the changes. Then I switched to the master branch and tried to do a merge. It said I had uncommitted changes. So I did a commit on the master branch to see what it was talking about. It said that there is a file called UserInterfaceState.xcuserstate that was modified. So I committed the change (not sure what the change was). Then I tried to merge again. It then opens up a merge window and indicates that there is a conflict with UserInterfaceState.xcuserstate. So I went back to the branch and found that that same file is now needing to be committed. This did not show up before. So I committed it and went back to the master branch. Again I tried to merge but cant because of uncommitted changes. Sure enough, UserInterfaceState.xcuserstate is once again needing to be committed. I committed it and tried to merge. Same problem with conflict. Its a vicious circle.

我创建了一个分支并进行了一系列更改。我提交了更改,然后将更改存档。然后我切换到主分支并尝试进行合并。它说我有未提交的更改。所以我在 master 分支上做了一个提交,看看它在说什么。它说有一个名为 UserInterfaceState.xcuserstate 的文件被修改。所以我提交了更改(不确定更改是什么)。然后我再次尝试合并。然后它打开一个合并窗口并指示与 UserInterfaceState.xcuserstate 存在冲突。所以我回到分支,发现现在需要提交同一个文件。这在之前没有出现过。所以我提交了它并回到主分支。我再次尝试合并,但由于未提交的更改而无法合并。果然,UserInterfaceState。xcuserstate 再次需要提交。我承诺并尝试合并。冲突的同样问题。它的恶性循环。

What is this file and how do I resolve the reported conflict. It does not show up in my project navigation window. Furthermore, it is not in the unix file system. I am totally stuck. Suggestions? I am using xcode 4.5.2

此文件是什么以及如何解决报告的冲突。它没有显示在我的项目导航窗口中。此外,它不在 unix 文件系统中。我完全被困住了。建议?我正在使用 xcode 4.5.2

采纳答案by DrummerB

UserInterfaceState.xcuserstateis where Xcode saves your GUI states, such as window positions, open tabs, expanded nodes in the project inspector etc.

UserInterfaceState.xcuserstate是 Xcode 保存您的 GUI 状态的地方,例如窗口位置、打开的选项卡、项目检查器中的扩展节点等。

Simply resizing the Xcode window will cause this file to change and be flagged as modified by your source control system. You can make your SCM system ignore specific files that are not important to the project itself.

简单地调整 Xcode 窗口的大小将导致此文件发生更改并被标记为被您的源代码控制系统修改。您可以让您的 SCM 系统忽略对项目本身不重要的特定文件。

Git: Git ignore file for Xcode projects
Subversion: SVN ignore pattern with Xcode 4

Git:Xcode 项目的 Git 忽略文件
Subversion:使用 Xcode 4 的 SVN 忽略模式

回答by Ankit Sachan

just remove files using

只需使用删除文件

git rm --cached *xcuserstate

git rm --cached *xcuserstate

then do a local commit selecting .DS_Store with miscellaneous message

然后做一个本地提交选择 .DS_Store 和杂项消息

discard all other changes

放弃所有其他更改

pull

push

done :)

完毕 :)