美文网首页
How can I add an empty folder to

How can I add an empty folder to

作者: 落魄平生 | 来源:发表于2017-06-27 00:58 被阅读0次

How can I add an empty folder to a repository?

Let's start with a tiny bit of background information: Git does not care about folders - it cares about files. Therefore, if a folder is empty, Git will not offer you to add it to version control.

While there is no "standard" solution to this problem, there are a couple of different approaches to "circumvent" this behavior.

Adding a .keep File

A popular solution is to simply add a file named ".keep" in the corresponding folder. You can now stage and commit this file and, as a consequence, also add the folder to version control.

Note that .keep is not a "magical" name but rather a popular convention. Also, the file doesn't serve any other purpose beyond making its containing folder visible to Git.
Source www.git-tower.com

相关文章

网友评论

      本文标题:How can I add an empty folder to

      本文链接:https://www.haomeiwen.com/subject/jilscxtx.html