git Rails:为什么每个目录中都有 .keep 文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29183372/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Rails : why is there .keep file in every directory
提问by illusionist
I see .keep
file in every directory in rails skeleton.
what is that file for?
What is its significance?
我.keep
在 rails 框架的每个目录中看到文件。
那个文件是做什么用的?
它的意义是什么?
回答by Pawe? Dawczak
This is not for Rails actually, this is for git.
这实际上不是针对 Rails 的,这是针对 git 的。
Git doesn't track "empty" directories, so, the directories like eg. "/logs" wouldn't end up in the repository. Having a .keep
in it, makes the directory to be tracked.
Git 不跟踪“空”目录,因此,例如目录。“/logs”不会出现在存储库中。有一个.keep
在里面,使目录被跟踪。
Updates:
更新:
In Unix based systems, files starting with a dot(.
) are considered hidden and do not appear in the UI. Hence might not disturb you.
在基于 Unix 的系统中,以点 ( .
)开头的文件被认为是隐藏的,不会出现在 UI 中。因此可能不会打扰您。