Git will ignore empty directories. The currently more mainstream approach, in addition to the one mentioned by @Millson, there is another approach that I personally find more convenient, which is to create a new one in the directory .gitkeep 文件(文件名其实随意,不过常见的是 .gitkeep 和 .keep)
I remember that git cannot submit an empty directory, but it may be possible to work around it, first let there be files in the folder, and then delete the files. Just to provide ideas, you can try it
Git will ignore empty directories. The currently more mainstream approach, in addition to the one mentioned by @Millson, there is another approach that I personally find more convenient, which is to create a new one in the directory
.gitkeep
文件(文件名其实随意,不过常见的是.gitkeep
和.keep
)Add the .gitignore file in the empty directory, the content is
Then git add empty can
I remember that git cannot submit an empty directory, but it may be possible to work around it, first let there be files in the folder, and then delete the files. Just to provide ideas, you can try it