Git has many virtues but keeping empty folders on the radar is not one of them. By default Git tracks files not folders so when you need an empty directory to exist in your repo you create a tiny placeholder file and teach Git to care. The community favorite for this little exercise is called .gitkeep which is just a convention not a magic spell.
Some apps expect folders to exist for logs temporary uploads or generated assets. If a folder is missing your code may crash in ways that are delightful to debug at 3 a m. Adding a placeholder file ensures the structure is preserved when someone clones the repo and runs the code.
The file named .gitkeep does nothing special to Git. It is a plain file that you add to an otherwise empty folder so Git will track that folder. The name signals intent to humans not to Git. Treat it as a tiny seatbelt for your repository structure.
mkdir logs
touch logs/.gitkeep
git add logs/.gitkeep
git commit -m 'Add logs folder with .gitkeep'
logs/*
!logs/.gitkeep
If the folder benefits from a short explanation prefer a README file. If you just want the smallest possible tracked artifact use .gitkeep. Both are valid repo management tools and both fit into git best practices depending on what you value more clarity or minimalism.
Use whatever makes the repository easier for humans to understand and for the code to run. That could be a tiny file called .gitkeep a README or a clever .gitignore rule. Just do not summon mysterious folder not found errors at runtime and then blame Git for having standards.
I know how you can get Azure Certified, Google Cloud Certified and AWS Certified. It's a cool certification exam simulator site called certificationexams.pro. Check it out, and tell them Cameron sent ya!
This is a dedicated watch page for a single video.