# .git exposure
*Exposure*
Block access to /.git/ so the repository history is not downloadable.

## Why it matters
If /.git/ is public, the whole history can be reconstructed, including secrets that were deleted later.
Deleting a key from the current code does not remove it from history. Blocking the path is the simple fix.

## How to fix it
1. Request /.git/config and confirm it returns 404
2. Block dotfiles at the server or CDN
3. Rotate any secret that was in the repository

## Prompt for an AI assistant
Copy the text below and paste it into an AI assistant.
```text
You are the person improving this website. Check the item below and fix it if it applies to the site.

Item: .git exposure
Summary: Block access to /.git/ so the repository history is not downloadable.
Steps:
1. Request /.git/config and confirm it returns 404
2. Block dotfiles at the server or CDN
3. Rotate any secret that was in the repository
References:
- Review Web server configuration (OWASP WSTG) (https://owasp.org/www-project-web-security-testing-guide/)

Constraints:
- Keep the existing design and tone of voice.
- Show the file or section you changed and the suggested final wording.
- Do not decide ambiguous points alone; give options and a recommendation.
- Do not change anything outside the listed item.
```

## Checked by
- **[vuln](https://ismyappok.com/en/vuln/checks)** — Public exposure checks

## Related checks
- **[.env file exposure](https://ismyappok.com/en/checks/env-file-exposure)** — Make sure .env and other secret files cannot be downloaded from the public site.
- **[Secrets in client JavaScript](https://ismyappok.com/en/checks/client-secrets)** — Keep API keys and tokens out of the JavaScript that browsers download.

## References
- **[Review Web server configuration (OWASP WSTG)](https://owasp.org/www-project-web-security-testing-guide/)** — OWASP guide（Reference）

## Check your site now
Enter a URL and find what is missing before launch, for free.
[Run audit](https://ismyappok.com/en/audit/check)