In SVN is there a command I can use to delete all locally missing files in a directory?
Or failing that, some way of listing only those files that are missing (or, in the more general case, have status A, D, ?, etc.)
In SVN is there a command I can use to delete all locally missing files in a directory?
Or failing that, some way of listing only those files that are missing (or, in the more general case, have status A, D, ?, etc.)
An alternative that works on Linux (bash) for to-be-removed files not containg spaces in path:
If you are using TortoiseSVN, just do a Check for Modifications, sort by the Status column, select all the entries marked
missing
, right-click to open the context menu, and select Delete. Finally, commit to publish the changes to the repository.If you are on Windows, but prefer the command-line and enjoy dabbling in PowerShell, this one-liner will do the trick:
That is, filter the output to only those lines showing missing files (denoted by an exclamation at the start of the line), capture the associated file name, and perform an
svn rm
on that file name.(Blog post Remove all “missing” files from a SVN working copy does something similar for Unix/Linux.)
This shell script, recursively examines (
svn status
) directories in your project, removing missing files (as the question demands) and adding new files to the repository. It is some sort of "store into the repository the current snapshot of the project".It is actually possible to completely remove the
missing.list
from user3689460 and Paul MartinWhen dealing with a lot of files, it can happen that the argument input to xargs is getting too long. I went for a more naive implementation which works in that case, too.
This is for Linux:
svn status
svn remove
each file