Overview:
Unity Version Control (formerly Plastic SCM) does not include a built-in command equivalent to git clean -fdx from Git.
However, you can achieve the same result by combining the cm status command with shell deletion tools.
This approach allows you to remove:
- Untracked files (
--private) - Ignored files (
--ignored) - Including directories (similar to
-din Git)
Solution:
1. Preview files to be deleted (Dry run)
We strongly recommend reviewing the files before deleting them:
cm status --private --ignored --short --fp --cutignoredParameters explained:
--private→ untracked files--ignored→ files matched byignore.conf--short→ compact output--fp→ full paths--cutignored→ avoids recursion into ignored directories (important for large folders likeLibrary/in Unity projects)
2. Delete files (Equivalent to git clean -fdx)
macOS / Linux
cm status --private --ignored --short --fp --cutignored | xargs -I {} rm -rf "{}"Windows (PowerShell)
cm status --private --ignored --short --fp --cutignored | % { Remove-Item -Recurse -Force $_ }Important considerations
- This operation is destructive and cannot be undone
- No confirmation prompt is shown
- Make sure to review the dry run output before executing deletion
Common use cases:
- Cleaning Unity project folders (
Library/,Temp/, build artifacts) - Resetting workspace to a clean state
- Preparing environments for CI/CD pipelines