Dry-run a cleanup of untracked files.
Section: Clean and Temporary File Management
Preview untracked file deletion
bash
bash
git clean -nExplanation
Always preview before cleaning. This is the safest habit for `git clean`.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Clean and Temporary File Management
Delete untracked files and directories
Remove untracked files and directories.
Delete ignored files too
Remove ignored and untracked files and directories.