Command to recursively remove all .svn directories

2019-01-16 00:28发布

I have a directory with many sub-directories. In each folder there is a subversion folder (.svn).

Is there a command in windows that will go through each folder and sub-directory and delete the .svn folder?

Or will I have to create a script or do it manually?

7条回答
Melony?
2楼-- · 2019-01-16 01:25

As an important point, if you want to run shell to delete .svn folders, you may need -depth argument to prevent find command entering the directory that was just deleted and showing silly error messages like e.g.

"find: ./.svn: No such file or directory"

To get rid of this error, you can use the find command as the following:

cd [dir_to_delete_svn_folders]
find . -depth -name .svn -exec rm -fr {} \;
查看更多
登录 后发表回答