简体   繁体   中英

remove all .svn dirs recursively

I found this solution:

find -type d -name .svn|xargs rm -rf

but I am on mingw environment (its bashy enough for me to deal with it anyhow) so I do not have the find command. I do however have use of ls -aR and such. Any tips?

您可能要安装MSYS ,并安装它提供的findutils。

find.exe is part of Msys(git). So is xargs.exe (not sure if it was with Mingw)

Alternatively, try Powershell ( you are on Windows afterall):

gci c:\path\to\workingcopy -include .svn -Recurse -Force | rm -Recurse -Force

My half solution i ended up using:

ls -aR | egrep ".*.svn:" | sed s/.$// | xargs rm -rf

I will note that it failed to take care of one dir which had spaces in it, for the windows shell to handle that correctly it needed to have quotations (not sure if escaping the space works). Other than that it did work fine.

Better solutions that I should be using next time around:

  1. svn export

  2. getting find to work

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM