fix-gitignore
Audits and fixes .gitignore files by adding missing entries.
Usage
git-wrangler fix-gitignore [--repo <path>] [--yes] [--guided]
What it does
Discovers Git worktrees under the current directory, or targets exactly one worktree with --repo, and adds missing .gitignore entries for known generated or local-only files that physically exist in the repository.
Options
| Flag | Required | Description |
|---|---|---|
--repo <path> | Optional | Target exactly one repository instead of discovering recursively. |
--yes | Optional | Skip the interactive confirmation prompt. |
--guided | Optional | Interactively configure command options before execution. |
Candidate entries checked:
| Pattern | Applies to |
|---|---|
node_modules/ | Node dependencies |
dist/ | Build output |
build/ | Build output |
bin/ | Compiled output |
obj/ | .NET output |
.idea/ | JetBrains settings |
vendor/ | Vendored dependencies |
wp-includes/ | WordPress core |
.DS_Store | macOS metadata |
Thumbs.db | Windows metadata |
*.log | Log files |
Example
git-wrangler fix-gitignore --yes
Notes
- Only adds entries — never removes existing rules
- Only adds a pattern if that file/directory physically exists on disk
- Prompts before changing
.gitignoreand creating a commit unless--yesis supplied - Commits updates with
Update .gitignore with missing entries - Does not untrack already-tracked files (use
git-wrangler untrackfor that)