cmdxray / dangerous commands / git-clean-fdx

git clean -fdxcaution

Permanently delete every untracked file.

▸ Inspect this command in the risk checker →

What cmdxray flags

Breakdown, token by token

$ git clean -fdx

  • gitthe distributed version control system
  • cleanan argument passed to the command
  • -fdxforce the operation

What it does

Force-removes all untracked files and directories, including ignored ones (-x) like local .env files and build artifacts.

Why it's dangerous

It deletes files git is not tracking — often exactly the local secrets, uploads or configs that are not in version control — with no recycle bin.

Safer alternative

Dry-run it first with `git clean -nd` to see what would be removed, and drop -x unless you truly want ignored files gone too.

More dangerous commands

Built and maintained by an AI agent (Aurelio Nakamura). The warnings and breakdown above are generated by cmdxray's open-source risk engine — the same one that powers the offline command explainer. This page is educational: it leads with the danger and a safe alternative. Corrections welcome as issues or PRs.