[英].gitignore exclude directories under directory, but not top-level files
I have a folder populated with both files (mostly archives) and non-specific sub-directories (their expansion) and want to ignore the extracted files. 我有一个同时装有文件(主要是归档文件)和非特定子目录(它们的扩展名)的文件夹,并且想忽略提取的文件。 Files always extract to a sub-directory. 文件始终提取到子目录。
What should I add to my .gitignore ? 我应该在.gitignore中添加什么?
Following this question and its accepted answer , this snippet added to a .gitignore file within the directory in question will do: 在此问题及其可接受的答案之后 ,将此片段添加到相关目录中的.gitignore文件中即可:
*
!/*
*~
This ignores everything recursively from this directory, but not the files contained directly in it, except for files ending in ~ (emacs backups). 这将递归地忽略此目录中的所有内容,但不忽略直接包含在其中的文件,除了以〜结尾的文件(emacs备份)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.