A solution to this problem is to delete only the project's meta-data directories, back-up the project files to a temporary directory, re-check out the project code from the source control system, and overlay the backed-up project files onto the pristine project (which has uncorrupted meta-data).
This is the simple Unix command I use for deleting all the Subversion meta-data in a directory and in its subdirectories:
- find . -name .svn -type d -print | xargs rm -r -f
It is pretty straightforward to interpret what is happening with this command. It is finding any directory (-type d) named .svn in the current directory (.) and its subdirectories. Each of those directories is deleted (rm -r) without prompting (-f). -print | xargs can be interpretted as use each result from the find command as input to the rm command.
find is very robust in what it can take as input, so a more general version of this line could be rewritten as:
- find </path/to/a/directory> -name <a_regex> -type <d | f> -print | xargs rm -r -f
It can then be used to delete from a branch of the filesystem heirarchy any files or directories whose names match some pattern.
2 comments:
Fantastic, thank you! What a powerful command - it saved my day when I just couldn't get "svn export" to work (still new to Subversion)!
Very happy to be of help. Thanks for the feedback!
----Tim----
Post a Comment