SVN Remove Added File From Repository and Keep Local File – Subversion

This is quick SVN (Subversion) tip, howto remove added file from SVN repository without deleting file from local filesystem.

Remove File From SVN Repository and Keep Local File


svn delete --keep-local path/to/file.example

Real example:


svn delete --keep-local css/test.css

Real world usage example
Adding a whole directory add a file that was not intended to SVN reads, but should be retained locally.


svn add css/
A         css
A         css/testing_styles.css
A         css/style.css

style.css is OK, but testing_styles.css should not be commited, but it should be kept on locally. Simply remove it from svn but keep it locally:


svn delete --keep-local css/testing_styles.css
D         css/testing_styles.css

File is deleted from SVN repository, but kept locally:


svn status
A       css
?       css/testing_styles.css
A       css/style.css

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Close