Automatically remove Subversion unversioned files

前端 未结 30 3143
感情败类
感情败类 2020-11-28 18:54

Does anybody know a way to recursively remove all files in a working copy that are not under version control? (I need this to get more reliable results in my automatic build

30条回答
  •  情话喂你
    2020-11-28 19:12

    Might as well contribute another option

    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

提交回复
热议问题