我有一个项目,它的树结构如下所示:
+ /Root - .gitignore + - - /Folder A - - - .gitignore <--- this fellow + - - - /bin - - - - - fileA + - - - - fileB + - - - /Folder AA + - - /FolderB + - - - /bin ...
在.gitignore
根文件夹有很多的规则,其中是忽略所有/bin
-folders。但是,FolderA
我希望所有内容都保持原样 - 一直在该文件夹中。FolderB/bin
另一方面应该被忽略。
我知道这可以通过添加另一个.gitignore
in 来实现FolderA
,并让它覆盖根文件夹的.gitignore
. 但我不记得是怎么做的。
我应该写FolderA/.gitignore
什么?
编辑:换句话说:“FolderA
是一个神圣的文件夹,并且必须将其中的所有文件都保留在其中,而不管其他任何.gitignore
文件必须说什么”
找到的解决方法:
在.gitignore
需要排除的文件夹中添加的文件中,添加以下行作为唯一行:
!*/
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句