Skip to content

Git and saving your work

Stop committing files that shouldn’t be in Git

The .env file, node_modules or build output ended up in the repository.

What you get
A correct .gitignore, the wrong files no longer tracked, and any exposed secrets flagged.
Paste it into
Your AI tool, in your project
The prompt
Check what this repository is tracking that it shouldn't.

Look for: environment files with real values, dependency folders, build output, editor and system files, logs, database files, and large media. Show me what you find and how much of the repository's size it accounts for.

Fix the .gitignore for this stack and stop tracking those files without deleting them from my disk. If any file with secrets was ever committed, list each secret by name only and tell me it needs replacing, because removing the file now doesn't remove it from history. Make sure an example environment file with placeholder values is tracked instead.

Use it

Open your AI tool (Claude Code, Codex or Cursor) in your project folder and paste it in.

More in Git and saving your work