shlogg · Early preview
Ramu Narasinga @karthik-m22

What Is .gitkeep And Where To Find It In Shadcn/ui Codebase?

.gitkeep` file: a blank file added to empty directories to sync local dir structure with GitHub repo. Found in Shadcn/ui codebase, e.g., `pages/api`, `pages`, and `registry` dirs. Not needed after initial push.

I came across a file named .gitkeep whille studying Shadcn/ui source code and I wanted to share what it is about in this article.
We look at the following:

What is .gitkeep file?
Where do you find .gitkeep in shadcn/ui codebase?

  
  
  What is .gitkeep file?

Git only tracks files not directories, so when you create empty directories and push, these empty directories are not pushed to your repository unless you have some file in it.
To solve this problem, you could simple add a dummy file in your directories and push it and have the latest directory structure reflected on your Github repo o...