Does svn have a `revert-all` command?

后端 未结 4 1253
无人及你
无人及你 2021-01-29 21:10

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 ea

相关标签:
4条回答
  • 2021-01-29 21:43

    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

    0 讨论(0)
  • 2021-01-29 21:43

    To revert modified files:

    sudo svn revert
    svn status|grep "^ *M" | sed -e 's/^ *M *//'
    
    0 讨论(0)
  • 2021-01-29 21:45

    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
    
    0 讨论(0)
  • 2021-01-29 22:02

    Use the recursive switch --recursive (-R)

    svn revert -R .
    
    0 讨论(0)
提交回复
热议问题