.gitkeep
isn't documented, because it's not a feature of Git.
(.gitkeep
没有记录,因为它不是Git的一个功能。)
Git cannot add a completely empty directory .
(Git 无法添加一个完全空的目录 。)
People who want to track empty directories in Git have created the convention of putting files called .gitkeep
in these directories. (想要在Git中跟踪空目录的人已经创建了将这些名为.gitkeep
文件放在这些目录中的约定。)
The file could be called anything; (该文件可以被称为任何东西;)
Git assigns no special significance to this name. (Git对此名称没有特别的意义。)
There is a competing convention of adding a .gitignore
file to the empty directories to get them tracked, but some people see this as confusing since the goal is to keep the empty directories, not ignore them;
(有一个竞争的惯例是将.gitignore
文件添加到空目录中以跟踪它们,但有些人认为这令人困惑,因为目标是保留空目录,而不是忽略它们;)
.gitignore
is also used to list files that should be ignored by Git when looking for untracked files. (.gitignore
还用于列出Git在查找未跟踪文件时应忽略的文件。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…