tags:

views:

96

answers:

5

Hi,

I have a svn working directory. I made some changes in that directory and it shows in 'svn status'. But is there any way for me to remove all my changes in there and just get everything from the trunk using command line?

Thank you.

+6  A: 
svn revert -R .
svn up

This will recursively revert the current directory and everything under it and then update to the latest version.

Mike McQuaid
+1  A: 

svn revert will undo any local changes you've made

Sean
+1  A: 

svn revert

Nick
A: 

If you have no changes, you can always be really thorough and/or lazy and do...

rm -rf *
svn update

But, no really, do not do that unless you are really sure that the nuke-from-space option is what you want!! This has the advantage of also nuking all build cruft, temporary files, and things that SVN ignores.

The more correct solution is to use the revert command:

svn revert -R .

The -R causes subversion to recurse and revert everything in and below the current working directory.

bbum
A: 
svn status | grep '^M' | sed -e 's/^.//' | xargs rm

svn update

Will remove any file which has been modified. I seem to remember having trouble with revert when files and directories may have been added.

Juan