问题描述
xcuserdata / ** / *
!xcuserdata / ** / xcschemes / *
但下列文件仍被追踪
/MyApp/MyApp.xcodeproj/xcuserdata/colas.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
为什么会这样? PS:如果我有
MyApp.xcodeproj / xcuserdata / colas.xcuserdatad / xcdebugger
如何解决这个问题? ,这些文件被忽略。但我不明白为什么它没有忽视这些黑客。
编辑1
与其中一个答案中的内容相反,该模式
xcuserdata / ** / *
!xcuserdata / ** / xcschemes / *
作品!!!我的意思是,跟踪 / xcschemes
下的文件。
另请参阅,我得到这个 .gitignore
文件。
编辑2
我的 Git
版本是 1.8.3.4(Apple Git-47)
。
编辑3
当我 git check-ignore
这个文件时,这里是我得到的
fatal:不是git仓库(或任何父目录):.git
但事实上,父目录是一个git目录...
编辑4
当我 git check-ignore --no-index -
这个文件,这里是我得到的
[MT] PluginLoading:所需的插件兼容性UUID 37B30044-3B14-46BA-ABAA-F01000C27B63适用于路径'〜/ Library / Application Support / Developer / Shared / Xcode / Plug-ins / XcodeSnippetsHelper.xcplugin'不存在于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:
致命错误:不是gi (或任何父目录):.git
编辑4bis
如果我不使用<$ c
$ b
c> no-index 选项,没有回复 git check-ignore
。
如果我使用 奇怪; - ! 其次,阅读: 因此, 请记住: 您在能够排除文件之前,需要从 请注意,使用git 2.9.x / 2.10(2016年中期?),如果该文件的父目录是排除。 正试图添加此功能: 然而: 所以这在这里不会有效。 My But the following file is still tracked Why is it so? How can I fix that? PS: If I had Contrary to what is said in one of the answer, the pattern works !!! I mean, the files under See also the post Git ignore file for Xcode projects, where I get this My When I But the fact is that a parent directory is a git directory... When I From the root folder : if I don't use the if I use the Strange ;-! First, you can do a Second, read " So the file of Remember: You need to exclude folders from the Note that with git 2.9.x/2.10 (mid 2016?), it might be possible to re-include a file if a parent directory of that file is excluded if there is no wildcard in the path re-included. Nguyễn Thái Ngọc Duy ( However: So that wouldn't have worked here anyway. 这篇关于为什么这些文件不被git忽略?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! no-index
选项:我得到错误错误:未知选项'no-index'$ c
xcschemes
的文件不会被忽略。
您需要。
但更好的方法是仅忽略文件,然后排除该文件夹:
xcuserdata / **
!xcuserdata / ** /
!xcuserdata / ** / xcschemes / **
gitignore
规则中排除文件夹。
.gitignore
file contains these lines : xcuserdata/**/*
!xcuserdata/**/xcschemes/*
/MyApp/MyApp.xcodeproj/xcuserdata/colas.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
MyApp.xcodeproj/xcuserdata/colas.xcuserdatad/xcdebugger
, the files are ignored. But I don't understand why it does not ignore them without this "hack".EDIT 1
xcuserdata/**/*
!xcuserdata/**/xcschemes/*
/xcschemes
are tracked. .gitignore
file. EDIT 2
Git
version is 1.8.3.4 (Apple Git-47)
.EDIT 3
git check-ignore
this file, here is what I get fatal: Not a git repository (or any of the parent directories): .git
EDIT 4
git check-ignore --no-index --
this file, here is what I get[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
EDIT 4bis
no-index
option, there is no reply to git check-ignore
.no-index
option: I get the error error: unknown option 'no-index'
...git check-ignore
(git 1.8.3.3+) to see what rule is ignoring your file (assuming it wasn't in the index in the first place).gitignore
exclude folder but include specific subfolder":xcschemes
wouldn't be un-ignored anyway.
You needed to ignore parent folder per parent folder.
But a better approach is to ignores files only, and then exclude the folder:xcuserdata/**
!xcuserdata/**/
!xcuserdata/**/xcschemes/**
gitignore
rules before being able to exclude files.pclouds
) is trying to add this feature: