Is there a Subversion command to reset the working copy?

前端 未结 9 1624
时光说笑
时光说笑 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:14

    You can recursively revert like this:

    svn revert --recursive .

    There is no way (without writing a creative script) to remove things that aren't under source control. I think the closest you could do is to iterate over all of the files, use then grep the result of svn list, and if the grep fails, then delete it.

    EDIT: The solution for the creative script is here: Automatically remove Subversion unversioned files

    So you could create a script that combines a revert with whichever answer in the linked question suits you best.

提交回复
热议问题