====== Situation ====== Sometimes we require to replace an entire directory and its sub-directories with new files. However if we simply delete the directory (which is under SVN) and replace it, then SVN will complain that the new directory is not a working copy and will not allow the net changes to be committed. Short of "svn deleting" the entire directory and "svn adding" it, the following steps can be performed. ====== Steps ====== The steps assume you want to do this for the mantis directory under /var/www/sub. This was actually perfomed when upgrading mantis as my mantis install is under SVN. - Deleted (and actually backed up as well) the current mantis folder - Unzipped the new version into the current name - SVN commit, complains that this is not an SVN directory of here are the alternate steps - **Run** ''cd mantis'' **to change directory into the mantis directory** - **Run** ''find .|grep -v "\.svn"|xargs rm'' **to delete all files except SVN related files and directories** - **Run** ''cp -R mantis1/* mantis/'' **assuming mantis1 directory already has the new extracted files. Before doing this slip a directory back and then go back up to mantis directory for next step** - **Run** ''svn status|grep "^\!"|awk '{print $2}'|xargs svn delete'' **to "SVN Delete" the deleted files** - **Run** ''svn status|grep "?"|awk '{print $2}'|xargs svn add'' **to "SVN Add" the new files** - **Run** ''svn commit -m "Whatever comment"'' **to finish the commit**