Clear-Junk Find or remove ignored files in the active project folder.
Description
Clear-Junk uses your project's .gitignore to identify files that are considered junk - build outputs, editor leftovers, temporary files, anything you have already declared as not worth saving. By default, Clear-Junk lists what would be removed but takes no action. Pass -Force to actually delete the listed files.
Tracked files are never touched. Files that are untracked but not matched by .gitignore are not touched either; pass -Aggressive together with -Force to also remove those.
Each invocation writes a self-contained diagnostic log file. Successful runs log silently; failures throw a plain-English message and point at the log file with the technical detail.
Recipes
Clear-Junk
Clear-Junk -Force
Find-CodeChange; Clear-Junk; Find-CodeChange
Notes
Safety:
- Default is a list-only dry run; never deletes without -Force.
- Tracked files are never touched.
- Use Set-Vault -WriteIgnoreList if you want a starter .gitignore for a fresh project.
- Refuses to run during an unfinished merge, rebase, cherry-pick, revert, or bisect.
Parameters
Was this page helpful? Report an issue or suggest an improvement →