I find out there are many ways that people have been trying to commit a temporary directory. Should there be a standardized one? If yes, which one would it be? (it would be better to hear your justification too)
Here are a list of possible solution to track your directory in git:
- commit
.gitdirectoryfile. IMHO, it is more intuitive to use the worddirectorywhich refers to committed directory. - commit
.gitkeepfile. Unfortunately this is not documented as mentioned in the answer. But people have seems to agreed upon this to be the standard. I couldn't find any particular reason why this is more acceptable compared to.gitdirectoryintuitively. (perhaps for some historical reason from other SVC tools to enforce.keepmefile. - commit
.gitignorefile. This is by far official documented solution of committing an empty directory. Unfortunately there's a discussion going on .gitignore vs .gitkeep.some people see this as confusing since the goal is to keep the empty directories, not ignore them;
- commit
READMEfile. Anyway you have to write what this directory is for, and what files will be put there in the future. (It also solve the documentation problem too)
My philosophy is to keep things clean with what the majority of the community accept as the best practices or conventions of doing certain things.
How you would add an empty folder with Git?