如何只在目录内忽略目录和文件 [英] How to ignore directories and files only inside a directory
本文介绍了如何只在目录内忽略目录和文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有这个 .gitignore
文件:
app / cache / *
app / logs / *
app / bootstrap *
vendor / *
web / bundles /
app / config / parameters.yml
web / public / img / users / *
但我想要目录 web / public / img / users
不能被忽略(只有文件在里面)。
我的意思是,当一个 git clone repo
完成时,该目录必须被创建,而不是内部的文件。
web / public / img / users /
会忽略所有内容,并将此 .gitignore
添加到您的存储库。 I have this .gitignore
file:
app/cache/*
app/logs/*
app/bootstrap*
vendor/*
web/bundles/
app/config/parameters.yml
web/public/img/users/*
but I want the directory web/public/img/users
not to be ignored (only files inside).
I mean, when a git clone repo
is done, the directory must be made, but not the files inside. How can I do it?
解决方案
Put a .gitignore
file into web/public/img/users/
that ignores everything and add this .gitignore
to your repository.
这篇关于如何只在目录内忽略目录和文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文