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

FlagRequiredDescription
--repo <path>OptionalTarget exactly one repository instead of discovering recursively.
--yesOptionalSkip the interactive confirmation prompt.
--guidedOptionalInteractively configure command options before execution.

Candidate entries checked:

PatternApplies 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_StoremacOS metadata
Thumbs.dbWindows metadata
*.logLog 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 .gitignore and creating a commit unless --yes is supplied
  • Commits updates with Update .gitignore with missing entries
  • Does not untrack already-tracked files (use git-wrangler untrack for that)