Does Git delete empty folders?

This question already has an answer here:

  • How can I add an empty directory to a Git repository? 28 answers

  • Git doesn't delete empty folders; Git cannot track empty folders (or any kind of folder) in the first place. Git only tracks files, the folders are incidental. Git only creates folders on disk in order to house files; a folder with no files in it does not exist in Git's world-view.

    If you want to keep an "empty" folder in your Git repository, the convention is to add a hidden empty file to that directory, such as /java/.gitkeep

    链接地址: http://www.djcxy.com/p/7862.html

    上一篇: 可以让git跟踪空文件夹吗?

    下一篇: Git会删除空文件夹吗?