How can I delete all unversioned/ignored files/folders in my working copy?

前端 未结 12 1941
忘掉有多难
忘掉有多难 2020-11-28 19:06

If I have a working copy of a Subversion repository, is there a way to delete all unversioned or ignored files in that working copy with a single command or tool? Essential

12条回答
  •  猫巷女王i
    2020-11-28 19:46

    Modifying Yanal-Yves Fargialla and gimpf's answers using Powershell (but not being allowed to comment on the original post by Stackoverflow):

    powershell -Command "&{(svn status --no-ignore) -match '^[\?i]' -replace '^.\s+' | rm -recurse -force}
    

    This adds the carat ("^") to specify the start of line, avoiding matching all files that contain the letter "i". Also add the flags for -recurse and -force to rm to make this command non-interactive and so usable in a script.

提交回复
热议问题