Name

svn delete — Delete an item from a working copy or the repository.

Synopsis

svn delete [TARGET...]

Description

Items specified on the command line are scheduled for deletion upon the next commit. Files (and directories that have not been committed) are immediately removed from the working copy. The command will not remove any unversioned or modified items; use the --force switch to override this behavior.

If run on an URL, the item is deleted from the repository via an immediate commit.

Alternate Names

del, remove, rm

Changes

Working copy if operating on files, Repository if operating on URLs

Accesses Repository

Only if operating on URLs

Switches

--force
--force-log
--message (-m) TEXT
--file (-F) FILE
--quiet (-q)
--targets FILENAME
--username USER
--password PASS
--no-auth-cache
--non-interactive
--encoding ENC
          

Examples

Using svn to delete a file from your working copy merely schedules it to be deleted. When you commit, the file is deleted in the repository.

$ svn delete myfile
D         myfile

$ svn commit -m "Deleted file 'myfile'."
Deleting       myfile
Transmitting file data .
Committed revision 14.
          

Deleting a URL, however, is immediate, so you have to supply a log message:

$ svn delete -m "Deleting file 'yourfile'" file:///tmp/repos/test/yourfile

Committed revision 15.
          

Here's an example of how to force deletion of a file that has local mods:

$ svn delete over-there 
subversion/clients/cmdline/delete-cmd.c:47: (apr_err=195006)
svn: Attempting restricted operation for modified resource
svn: Use --force to override this restriction
subversion/libsvn_client/delete.c:90: (apr_err=195006)
svn: 'over-there' has local modifications

$ svn delete --force over-there 
D         over-there