折腾:
[已解决]Xcode中解决了git更新的project.pbxproj冲突后仍编译失败提示找不到新增swift文件中的类
之后,去
虽然手动解决了 project.pbxproj的冲突,但是还是有警告提示:
File still marked as conflicted
现在问题是:
如何把已经修改号的项目文件,标记为已解决冲突?
[解决过程]
1.搜:
xcode project.pbxproj
xcode project.pbxproj 冲突
xcode project.pbxproj conflict
参考:
xcode中的project.pbxproj冲突怎么解决 – 知乎
git – xcode 的project.pbxproj 的合并问题 – SegmentFault
truebit/xUnique: merge Xcode project file is so easy
Xcode中project.pbxproj合并冲突的解决 – 简书
Git-处理Xcode的project.pbxproj文件冲突问题 – 简书
Xcode Project file git merge conflict – Stack Overflow
Automatically resolving git merge conflicts in Xcode’s project.pbxproj file | Roadfire Software
但是回到项目文件列表中,是找不到这个:
project.pbxproj
文件的
-》其只是个Xcode的配置文件
不是独立的某个文件
xcode project.pbxproj how to mark conflict resolved
iphone – How to use Git properly with XCode? – Stack Overflow
xcode project.pbxproj File still marked as conflicted
git – Getting rid off "File still marked as conflicted" warning in XCode – Stack Overflow
Git 合并时冲突 Merge Conflict:file still marked as conflicted 解决方法 – backAFENG的专栏 – 博客频道 – CSDN.NET
xcode project.pbxproj
project.pbxproj,最熟悉的"陌生人" – 庞海礁的个人空间
后来找到了这个文件所在位置:
在:
SalesApp.xcodeproj-》右键 显示包内容-》中就有:project.pbxproj
去
git help add
看了看 -u 参数的含义:
-u, –update
Update the index just where it already has an entry matching <pathspec>. This
removes as well as modifies index entries to match the working tree, but adds
no new files.
If no <pathspec> is given when -u option is used, all tracked files in the
entire working tree are updated (old versions of Git used to limit the update
to the current directory and its subdirectories).
去试试:
git add SalesApp.xcodeproj/project.pbxproj
果然,没试之前,就通过
git status
中看到了:
Unmerged paths:
(use "git reset HEAD <file>…" to unstage)
(use "git add <file>…" to mark resolution)
both modified: SalesApp.xcodeproj/project.pbxproj
Changes not staged for commit:
(use "git add <file>…" to update what will be committed)
(use "git checkout — <file>…" to discard changes in working directory)
modified: Cartfile.resolved
modified: SalesApp/AddCustomerViewController.swift
modified: SalesApp/Base.lproj/Main.storyboard
modified: SalesApp/FilterCustomerViewController.swift
modified: SalesApp/HomeViewController.swift
modified: SalesApp/KKGestureLockView.m
其中未合并unmerged file的文件,本地和服务器端both modified都修改的文件,就是
上面我自己猜测的
SalesApp.xcodeproj/project.pbxproj
所以,通过git add 对应的文件,即可实现,等价于mark conflict resolved的效果了:
所以去执行:
xMacBook-Pro:SalesAppiOS y$ git add SalesApp.xcodeproj/project.pbxproj
如图:
如此,再去通过Xcode去提交项目文件
此时,对于:
project.pbxproj
就只是显示M==Modified
而不是之前的C=Conflict
了。
[总结]
通过git命令行add对应的project.pbxproj文件:
即可。
注:
project.pbxproj
是在项目中无法直接看到文件的。
是在你的项目文件xxx.xcodeproj-》右键 显示包内容-》project.pbxproj
的,所以对应命令是:
git add SalesApp.xcodeproj/project.pbxproj
即可解决问题
-》
如此,再去通过Xcode去提交项目文件
此时,对于:
project.pbxproj
就只是显示M==Modified
而不是之前的C=Conflict
了。