Skip to main content


clean | purge

delete untracked files

Delete all untracked files in your working copy. Untracked files are files that are unknown to Sapling. They are marked with "?" when you run sl status.

By default, sl clean implies --files, so only untracked files are deleted. If you add --ignored, ignored files are also deleted. If you add --dirs, empty directories are deleted and --files is no longer implied.

If directories are given on the command line, only files in these directories are considered.

Caution: sl clean is irreversible. To avoid accidents, first perform a dry run with sl clean --print.


-a--abort-on-errabort if an error occurs
--ignoreddelete ignored files too
--dirsdelete empty directories
--filesdelete files
-p--printprint filenames instead of deleting them
-0--print0end filenames with NUL, for use with xargs (implies -p/--print)
-I--includeinclude files matching the given patterns
-X--excludeexclude files matching the given patterns