Svn script to commit a set of deleted files

I deleted a lot of files from my local copy that were present in different subdirectories of the main directory. I want to delete all locally deleted files from my SVN repository.

If I check the SVN status of my main directory with svn st main_dir , then all deleted files are displayed with '!' The symbol means that the corresponding files are missing. But these files are not deleted from my SVN repository, even if I make my changes using svn ci main_dir .

Is there a way or command or script to remove all locally deleted files from my main directory and subdirectories from my SVN repository. I think we can skip all the files of each folder and delete the locally deleted files from SVN by checking the corresponding SVN STATUS file ('!'), But I donโ€™t know how to convert my idea into a script.

Can someone help me finish this task? Thanks in advance...

Shiva

+7
linux shell svn
source share
5 answers

for i in $(svn st | grep \! | awk '{print $2}'); do svn delete $i; done

+17
source share

I found xargs easier than the for loop:

 svn stat | grep \\! | awk '{print $2}' | xargs svn remove 
+3
source share
 for i in $(svn st | grep \! | awk '{print $2}'); do svn delete $i'@'; done 

For files with @ 2x in them.

+1
source share

You should have used svn delete PATH to delete these files. Thus, they are deleted both from your file system and from a working copy.

See svn delete for details.

I suggest you svn update to return files from a remote repository and delete them using svn delete .

0
source share

Also works with a space in file names:

 svn st | grep ! | sed 's/!\s*//' | xargs -I{} svn remove '{}' 
0
source share

All Articles