Skip to content

Upload Empty Folders with Git

When uploading project files with Git, there may be some empty folders that cannot be uploaded, and this is not related to .gitignore.

After checking the official documentation, I found that Git does not track empty folders by default, so empty folders cannot be uploaded. You can put a .gitkeep file (or any file) in the folder.

As shown in the figure, commit again and it will be successful.

gitkeep

Released under the [BY-NC-ND License](https://creativecommons.org/licenses/by-nc-nd/4.0/deed.en).