Is there a Subversion command to reset the working copy?

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

    Pure Windows cmd/bat solution:

    svn cleanup .
    svn revert -R .
    For /f "tokens=1,2" %%A in ('svn status --no-ignore') Do (
         If [%%A]==[?] ( Call :UniDelete %%B
         ) Else If [%%A]==[I] Call :UniDelete %%B
       )
    svn update .
    goto :eof
    
    :UniDelete delete file/dir
    IF EXIST "%1\*" (
        RD /S /Q "%1"
    ) Else (
        If EXIST "%1" DEL /S /F /Q "%1"
    )
    goto :eof
    

提交回复
热议问题