Last Updated: February 09, 2019
·
1.066K
· colinkeith

Git ignores empty folders

Migrated code from SVN to Git and found my folder tree was partially missing because git ignores folders. It is only concerned with files, so to force the folder tree to exist add an empty file to each folder that should exist and commit the changes. Edited based on feedback to add: Use a "dot-file" such as ".gitempty" to cause it to be omitted in standard file listings.

2 Responses
Add your response

It's better to rename the file to .gitkeep because it is a good practice to hide all .* files on the server. ide also hide such files by default. I mean this is "service" file.

over 1 year ago ·

That makes perfect sense. Thanks!

over 1 year ago ·