I've committed and pushed a project to my GitHub account.
This project contained the following partial file structure:
server
|
--- conf
|
----- some files
|
--- java
|
--- lib
The java and lib folders are empty.
When downloading my project from GitHub, the resulting zip did not contain the java and lib folders.
Does Git delete empty folders?
I am using Atlassian's SourceTree as my Git client.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With