For deployment, one should ideally “export” a project that is under version control (subversion, in particular, for the sake of this post). However, at times one ends up deploying a tarball of a checked-out copy of the project on the production server. There is nothing wrong with doing so as long as the checked copy is recent, save for the fact that each directory and subdirectory in that checked copy will contain a .svn directory that holds subversion’s meta-data files along with pristine copies of all the files in the diretory in which that .svn directory exists. These pristine copies are what make possible the magic that is svn diff and svn revert, among other things. The following is a handy little command to reap out all the .svn directories in a checked out copy of a project under subversion:
# find project/ -type d -name '.svn' -print | xargs rm -rf -
One can also avoid piping the output to xargs and use the nearly equivalent -exec switch to find to achieve similar result. I cannot remember at the moment, but there are some drawbacks of using -exec with find. However, your mileage may vary.