Your workspace is cluttered with files Git doesn't track — build artifacts, temp files, experiments. git clean removes all untracked files in one sweep.
Your project has tracked files (Git knows about them)
and untracked junk (Git doesn't know, doesn't care).
git clean -n = dry run (preview what dies)
git clean -f = force delete (actually sweep)
git clean -fd = files + directories
⚠️ This is destructive! Always dry-run first.
All untracked junk is gone. Only your tracked, committed files remain.
Clean workspace = clear mind.
Remember: always dry-run first with -n
to avoid accidentally deleting something important.
Pair git clean with git checkout -- . to reset everything back to the last commit state.