Is there a Subversion command to reset the working copy?

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

    To remove untracked files

    I was able to list all untracked files reported by svn st in bash by doing:

    echo $(svn st | grep -P "^\?" | cut -c 9-)
    

    If you are feeling lucky, you could replace echo with rm to delete untracked files. Or copy the files you want to delete by hand, if you are feeling a less lucky.


    (I used @abe-voelker 's answer to revert the remaining files: https://stackoverflow.com/a/6204601/1695680)

提交回复
热议问题