Is there a Subversion command to reset the working copy?

前端 未结 9 1531
时光说笑
时光说笑 2020-12-23 02:25

Is there a single Subversion command that would “reset” a working copy exactly to the state that’s stored in the repository? Something like git reset --hard or

相关标签:
9条回答
  • 2020-12-23 03:21

    Delete the working copy from the OS and check it out again is simplest, but obviously not a single command.

    0 讨论(0)
  • 2020-12-23 03:25

    Very quick and simple and does exactly what you want

    svn status | awk '{if($2 !~ /(config|\.ini)/ && !system("test -e \"" $2 "\"")) {print $2; system("rm -Rf \"" $2 "\"");}}'
    

    The /(config|.ini)/ is for my own purposes.

    And might be a good idea to add --no-ignore to the svn command

    0 讨论(0)
  • 2020-12-23 03:28
    svn revert . -R
    

    to reset everything.

    svn revert path/to/file
    

    for a single file

    0 讨论(0)
提交回复
热议问题