Skip to main content


remove | rm

delete the specified tracked files

Remove the specified tracked files from the repository and delete them. The files will be deleted from the repository at the next commit.

To undo a remove before files have been committed, use sl revert. To stop tracking files without deleting them, use sl forget.

--mark can be used to remove only files that have already been deleted, -f/--force can be used to force deletion, and -Af can be used to remove files from the next revision without deleting them from the working directory.

The following table details the behavior of remove for different file states (columns) and option combinations (rows). The file states are Added (A), Clean (C), Modified (M) and Missing (!) (as reported by sl status). The actions are Warn (W), Remove (R) (from branch) and Delete (D) (from disk):


sl remove never deletes files in Added state from the working directory, not even if --force is specified.

Returns 0 on success, 1 if any warnings encountered.


--markmark as a deletion for already missing files
-f--forceforget added files, delete modified files
-I--includeinclude files matching the given patterns
-X--excludeexclude files matching the given patterns