我的.gitignore
文件包含以下行:
xcuserdata/**/*
!xcuserdata/**/xcschemes/*
以下文件仍在被跟踪:
/MyApp/MyApp.xcodeproj/xcuserdata/colas.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
为什么会这样?我该怎么解决?PS:如果我有
MyApp.xcodeproj/xcuserdata/colas.xcuserdatad/xcdebugger
,那么这些文件就会被忽略。但是我不明白为什么没有这个“hack”它们就无法被忽略。
编辑1
与其中一个答案所说的相反,模式 xcuserdata/**/*
!xcuserdata/**/xcschemes/*
运行正常!我的意思是,/xcschemes
目录下的文件已被跟踪。
另请参阅帖子Git ignore file for Xcode projects,我在那里获取了这个.gitignore
文件。
编辑2
我的Git
版本是1.8.3.4(Apple Git-47)
。
编辑3
当我对此文件执行git check-ignore
命令时,我获得以下输出:
fatal: Not a git repository (or any of the parent directories): .git
但事实上,父目录是一个git目录...
编辑4
当我运行git check-ignore --no-index --
命令时,得到以下结果
[MT] PluginLoading: Required plug-in compatibility UUID 37B30044-3B14-46BA-ABAA-F01000C27B63 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/XcodeSnippetsHelper.xcplugin' not present in DVTPlugInCompatibilityUUIDs
2014-02-10 10:03:50.856 xcodebuild[1496:d07] XcodeColors: load (v10.1)
2014-02-10 10:03:50.859 xcodebuild[1496:d07] XcodeColors: pluginDidLoad:
fatal: Not a git repository (or any of the parent directories): .git
编辑4bis
从根文件夹开始:
如果我不使用
no-index
选项,则git check-ignore
不会有任何回复。如果我使用了
no-index
选项:我会收到错误消息error: unknown option 'no-index'
...
很奇怪吧;-!
git check-ignore --no-index -- yourFile
命令吗?它可以用来诊断哪些本应该被忽略的路径被错误地添加到了索引中。 - VonCcd /MyApp/MyApp.xcodeproj; git check-ignore -- xcuserdata/colas.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
- VonC