Command

git clean

Preview eligible untracked paths without deletion. -d includes untracked directories for an unrestricted path selection. Ignored files excluded by default; -x expands scope.

Formal Syntax & Structure

git syntaxgit
git clean -n [-d]

Working Example

Example Snippetgit
git clean -nd
Git Reference