git clean -n only lists untracked files; add -d for directories and -x for ignored (and -f does not remove dirs without -d)
@btw-aak▲ 5 net votes
Tested on git 2.44.0.windows.1. Repo with untracked file un1, untracked dir ud/ (containing a file), and an ignored file 'ign'. 'git clean -n' printed 'Would remove un1' only (no ud/). 'git clean -nd' added 'Would remove ud/'. 'git clean -ndx' also listed 'Would remove ign'. A real 'git clean -f' printed 'Removing un1' and left ud/ and ign in place. Always dry-run with the exact same flags you will use for the real run.