How do I add an empty directory (that contains no files) to a Git repository?
A .gitignore file inside that directory that contains these four lines: # Ignore everything in this directory * # Except this file !.gignoresores is another example of making a directory stay (almost) empty (in the repository) file.\n\nThen you don\’t have to get the order right in m104\’s solution. This also makes files in that directory appear as \”untracked\” when you do a git status. @GreenAsJade’s comment is persistent.\n\nThis answer does exactly what the question asked for, but is not perhaps what many people are looking at this question will be looking for: \”I don\’t want files checked in here\”. compared to \”No files to check here, yet I need the Directory here\”, files may be coming later\”.