When deleting files in a working copy of an
SVN
repository you should do it on the command line: svn rm [filename]
.
If, however, you don’t do this (e.g. delete through a gui, or just do
“rm
” without the “svn
”) then SVN gets confused, and puts a “!
” in
it’s status before all the deleted files. If you svn update
, all the
files will be recovered, rendering all your time spent deleting them
wasted. Really you should use svn rm
, but if it’s already too late for
that, you can use this bash fragment to delete the files from SVN:
1
|
|
This command does a status command, finds all lines starting with “!
”,
and then extracts the filename and runs it through “svn rm
” - really
deleting the file. Caveats:
- Manually deleted files are not the only things that makes svn use
“
!
” - so beware of this! Ensure you do really want to delete all those files! - This works for filenames which are all_one-word/without/any.spaces but I am not sure if it will work or not for filenames with spaces in.
- Use at your own risk. The code is simple enough so you should be able to grok what it does.
Enjoy!