Xcode-错误 : pathspec '...' did not match any file(s) known to git

标签 xcode git core-data

我正在使用本地 git 存储库。当我尝试提交对核心数据模型文件 (.xcdatamodel) 的更改时,我收到此消息:

error: pathspec '.../DataModel.xcdatamodeld/DataModel.xcdatamodel/contents' did not match any file(s) known to git.

如何像处理任何其他文件一样修复此问题并提交模型?

最佳答案

问题的确是文件名大小写的改变。对我来说,这是因为我的 Macbook/OSX。显然 Windows 具有相同的“东西”。

原因:git 无法识别从“文件名”到“文件名”的更改。

这里有一份解决方案列表,供遇到此问题的任何人使用。所有解决方案都应在项目根目录下运行:

适用于当前和 future 项目的永久修复

更改 git 大小写设置。该文件应在之后提交

git config core.ignorecase false --global

项目只修复

git config core.ignorecase false

只需给我一行代码,这样我就可以继续修复 - 感谢 Bruce

git commit -a -m "pathspec did not match any file(s) known to git fix"

我按小时计酬修复

Delete the file. Commit. Push. Add the file again. Commit. Push.

根据您的需要,您可能想要恢复设置。做:

git config core.ignorecase true 

关于Xcode-错误 : pathspec '...' did not match any file(s) known to git,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27325747/

相关文章:

ios - 在 crashlytics swift/ios 中具有非常大的行号值的 EXC_BREAKPOINT

git - 在本地和远程重命名 Git 分支?

iOS CoreData : How to setup the core data "connection"? Stanford UIDocument vs. Apple 模板?

ios - 尝试与此设备通信时遇到错误

ios - XCode 7.3.1 存档错误 : "Verify that your build process has compiled binaries and copied in bundle resources"

ios - UICollectionViewCell 没有选择项目不工作

Git 克隆错误 : RPC failed - curl 28 Operation too slow

git - 摆脱多个 Bamboo 构建计划

ios - 核心数据和可转换检索图像

objective-c - 是ThreadedCoreData示例(来自Apple)在主线程上创建NSManagedObjectContext吗?