Reputation: 12336
A vast amount of Googling, has, surprisingly, found no definitive reference stating that Subversion does 'allow empty folders'.
Extensive testing seems to show that Git does not allow empty folders, whereas, subversion does allow empty folders.
Can anyone provide a definitive answer or reference: if it is true that git does NOT allow empty folders.
Can anyone provide a definitive answer or reference: if it is true that Subversion does allow empty folders. (The Subversion book for example, actually says nothing, whatsoever, on the topic of empty folders, even though it would seem to be a major issue!)
Upvotes: 3
Views: 679
Reputation: 60393
By the way, if you want empty folders created in your checkouts, you can cheese submodules to get them:
j8=00000001
git update-index --add --cacheinfo 160000,$j8$j8$j8$j8$j8,path/to/emptydir
where the j8 shenanigans is just an easy way of getting the right number of digits.The only important part is 40-digit id that isn't all zeros. Checkout creates an empty subdirectory to prep the location for it getting filled in by submodule cloning or however you're managing it.
Upvotes: -1
Reputation: 1326736
As I explained in this answer:
Since an empty directory has no content, it isn't part of the snapshot.
Note that this is an implementation issue, not a fundamental git storage design problem.
See also the "Git Book" for more.
Upvotes: 6
Reputation: 272657
From the Git Wiki:
Currently the design of the Git index (staging area) only permits files to be listed, and nobody competent enough to make the change to allow empty directories has cared enough about this situation to remedy it.
From the Subversion book:
svn add
Schedule files, directories, or symbolic links in your working copy for addition to the repository.
Upvotes: 3