Git doesn't show untracked directories
This question already has an answer here:
Git
cannot add directories to the repository. Only files can be added.
If you want to add a directory put an empty .gitignore
file into it and add it.
您应该使用名为“.keep”或“.gitkeep”的空文件
An empty file called .gitignore
in each empty folder that you would like to commit can make good sense.
Especially if you (eventually) have certain files you would like to ignore in that specific folder but not others. .gitkeep
and .keep
end up being only helpful in the fact that they exist and will not provide any other functionality. They will end up being dead weight.
At least .gitignore
in those empty folders has the potential to be useful for more than the initial intent to track a folder.
上一篇: Git会删除空文件夹吗?
下一篇: Git不显示untracked目录