Alex Rivera | Logout

How to remove all deleted files from repository?

Asked 2011-01-05T20:21:27.637
48

I have a script in which I add all new files before to commit my working copy to my repository with this line:

svn status | grep ^\? | awk '{print $2}' | xargs svn add

I now want to add a line that delete from repository all deleted files in my working copy. In other terms, I cannot specify them one by one, and I need to detect them with svn status and then automatically remove them. However the line doesn't work.

svn status | grep ^\! | awk '{print $2}' | xargs svn --force delete

As you can see I've replaced

"?" with "!" and

"add" with "--force delete"

Could you tell me why it doesn't work ?

ps. I know it is a risky procedure. I've already discussed all about it. thanks

thanks

svn
Edit
Report

2 Answers

44

I have found another solution, too.

svn status | grep '^\!' | sed 's/! *//' | xargs -I% svn rm %

I have seen it on http://donunix.blogspot.de/2009/02/svn-remove-all-deleted-files.html

answered 2012-06-26T08:08:46.790
2

what about adding you could simply use

svn add --force .

or

svn --force add .

it would do the same: add all unversioned files except ones matching svn:ignore patterns

answered 2011-07-07T12:26:34.240

Your Answer