xcode – 为什么git不会忽略这些文件?
我的.gitignore文件包含以下行:
xcuserdata/**/* !xcuserdata/**/xcschemes/* 但仍会跟踪以下文件 为什么会这样?我该如何解决这个问题? PS:如果我有MyApp.xcodeproj / xcuserdata / colas.xcuserdatad / xcdebugger,则会忽略这些文件.但我不明白为什么没有这种“黑客”就不会忽视它们. 编辑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. 奇怪; – ! 解决方法
首先,您可以执行
git check-ignore (git 1.8.3.3)以查看忽略您的文件的规则(假设它首先不在索引中)
第二,阅读“
因此,无论如何都不会忽略xcschemes的文件. xcuserdata/** !xcuserdata/**/ !xcuserdata/**/xcschemes/** 记得: 在排除文件之前,您需要从gitignore规则中排除文件夹. 请注意,使用git 2.9.x / 2.10(2016年中期?),如果排除该文件的父目录,则可以重新包含文件if there is no wildcard in the path re-included. Nguy?n Thái Ng?c Duy ( > commit 506d8f1 for git v2.7.0,在commit 76b620d git v2.8.0-rc0中恢复 然而:
所以这无论如何都不会在这里奏效. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |