← Blog · 26 October 2026
Is your app's .git folder public? How to check
Check your app now: paste your address into the free Vibe-App Watchdog scan. From the outside, like any visitor, it checks if /.git/config and /.git/HEAD answer like real files. We never open or save what is inside.
Every project that uses Git has a hidden folder called .git. It holds your full history: every saved version of every file, plus settings like where your code is pushed (Git docs: repository layout).
That folder is meant to stay on your computer and in your code host. It should never be part of the live website.
Why a public .git folder is a problem
- Anyone who can download it can often rebuild your source code.
- It contains your history. A key you deleted from the code last week can still sit in an older version.
.git/configcan show where your code lives, and sometimes a remote address with a token in it, if one was ever pasted there.
It mostly happens when a whole project folder is copied to a server or a static host, instead of only the built files (like the dist folder from a Vite build).
How to check by hand
Only check apps you own.
- Open your live app in a private browser window.
- Go to
https://your-app.example/.git/HEAD.
- If you see one short line like ref: refs/heads/main, your .git folder is public. - If you get a 404 or your app's normal page, it is not reachable at that address.
- Try
https://your-app.example/.git/configtoo. A text file with[core]near the top means the same thing.
Single-page apps often show the home page for any unknown address. That is fine. What matters is whether you get the real Git file back.
How to fix it
- Publish only the build output. In your host settings, set the output folder to the build folder (for Vite that is usually
dist), not the whole project. - Block hidden files. If you run your own server, deny access to any path starting with
/.(like/.gitand/.env). - Assume keys in the history are leaked. If any password or API key was ever committed, create a new one and turn off the old one. Removing it from the code does not remove it from old versions.
- Check again with the steps above, or run the free scan.
A prompt you can give your AI builder:
Make sure my deploy only publishes the build output folder, never the .git folder or any hidden files. If I run my own server, block all paths that start with "/.". Then list any passwords or API keys that were ever committed in my Git history, so I can replace them.
What the free scan does and does not check
The scan is passive. It looks at security headers, common files that should not be public (like .env, .git and .DS_Store), patterns that look like secret keys in your public JavaScript, and public source map files. It cannot see your database rules (like Supabase Row Level Security), your Git history, your payment flow or your server code. A good result means we did not find the common problems we check for. It does not mean your app is fully safe.
The first scan is free. If you want the full report with a fix prompt for each finding, it is a one-time payment of $19, with no subscription.
Related: Is my .env file public? and Is your app's original source code public?.
Sources
- Git – gitrepository-layout: https://git-scm.com/docs/gitrepository-layout
- Git – git-config: https://git-scm.com/docs/git-config