Does svn have a `revert-all` command?

SvnCommand Line

Svn Problem Overview


If I want to throw away all of my changes, and return to the code that is on the repository, I do the following:

$ rm -fr *
$ svn up

This is easy enough, but I'm wondering if there is a single command that will accomplish this, something like:

$ svn revert-all

Svn Solutions


Solution 1 - Svn

You could do:

svn revert -R .

This will not delete any new file not under version control. But you can easily write a shell script to do that like:

for file in `svn status|grep "^ *?"|sed -e 's/^ *? *//'`; do rm $file ; done

Solution 2 - Svn

There is a command

svn revert -R .

OR
you can use the --depth=infinity, which is actually same as above:

svn revert --depth=infinity 

svn revert is inherently dangerous, since its entire purpose is to throw away data—namely, your uncommitted changes. Once you've reverted, Subversion provides no way to get back those uncommitted changes

Solution 3 - Svn

Use the recursive switch --recursive (-R)

svn revert -R .

Solution 4 - Svn

To revert modified files:

sudo svn revert
svn status|grep "^ *M" | sed -e 's/^ *M *//'

Solution 5 - Svn

To revert modified files:

svn revert -R <path_to_directory>

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionEric WilsonView Question on Stackoverflow
Solution 1 - SvnJuan Carlos MuñozView Answer on Stackoverflow
Solution 2 - Svnbilash.sahaView Answer on Stackoverflow
Solution 3 - SvnCLoView Answer on Stackoverflow
Solution 4 - SvnTaylor HawkesView Answer on Stackoverflow
Solution 5 - Svnyogesh.bhakharView Answer on Stackoverflow