in GNU/Linux, Programming, Version Control Systems

SVN reseting, the hard way

So, my subversion screwed up my remote repository, not allowing me to commit any local changes.
Unfortunately, it screwed up my local repository too with those .svn folders and directories so I had to do a hard way reset to make it work again.

This is how I did it:

First of all BACKUP BACKUP BACKUP!
I checked out my files at a new temporary directory:
cd tempmplampla
svn checkout http://myremoterepository/code

then delete everything in it:
svn remove *

then commit the changes:
svn commit

The remote repository is empty again. Nice!

I run the following command at my local repository to clean all the svn files:
cd /cleanedworkingcopy/
find . -name “.svn” -type d -exec rm -rf {} \;

Now you just have to copy the “cleaned” directory to the temporary directory you checkedout before:
cp -r /cleanedworkingcopy/* /tempmplampla/

and commit the new files once again:
svn add *
svn commit

That’s it!

Share