Search code examples
svnversion-control

How to remove a file from version control without deleting it?


If I run svn rm file, the file is removed from the local working copy.

What I do now is:

$ cp file file2
$ svn rm file
$ svn ci
$ mv file2 file

How do I avoid svn also deleting the local file when using svn rm?


Solution

  • You want the --keep-local command-line option. This removes the file from version control without removing it from your filesystem.

    $ svn rm --keep-local my_important_file
    

    Note: The --keep-local only affects the svn rm of your copy. Other users may have their own local copy of the file deleted unless there is a conflict between their local copy and the repository due to changes they have made. This may not be the desired outcome. See comments below.