DigiNews

Tech Watch Articles

← Back to articles

Git: Don’t create .gitkeep files, use .gitignore instead

Quality: 8/10 Relevance: 6/10

Summary

The article argues that Git tracks files, not directories, and compares two methods to ensure a directory exists in a repo. It critiques the common .gitkeep approach and presents a cleaner technique using a per-directory .gitignore to keep the directory tracked with a single file. It provides practical commands to implement and commit the directory reliably across renames and clones.

🚀 Service construit par Johan Denoyer