Autmatic add or remove files to an SVN repository

When you have added or removed a lot of fiels and directories in a local reopsitory, it can be a hard task to add them all by hand. These two small scripts help with adding or removing any files that were added or removed in the local repository. But use with care.

Add all local added files and directories from the repository.

svn add  `svn st | grep '^?.*' | tr -d '? ' | sort -n | tr '\n' ' '`

Remove all local deleted files and directories from the repository.

svn rm `svn st | grep '^!.*' | tr -d '! ' | sort -n | tr '\n' ' '`

After that you still need to run

svn commit


This article was published on And migrated to this blog.

in library3

About the author: Bèr Kessels is an experienced webdeveloper with a great passion for technology and Open Source. A golden combination to implement that technology in a good and efficient way. Follow @berkes on Twitter. Or read more about Bèr.

blog comments powered by Disqus