svn: how to clean up my repository directory?

I have a local svn repository. I work in the repository, e.g. compiling latex documents and building software packages, and there are many useless temporary files there. How can I clean it up by automatically clean these temporary files like the git clean -f in git?

svn seems has no built-in function for this. But you can remove untracked files like this:

svn st | grep '^?' | awk '{print $2}' | xargs -I{} rm -rf '{}'

In the svn st command’s results, the untracked files are marked with ? at the beginning of the lines of outputs.

Leave a Reply

Your email address will not be published. Required fields are marked *