SVN和CVS是我们常使用的项目版本管理工具,为我们的工作带来了很大的方便。但是,有时候我们需要删除里面的SVN和CVS文件夹。


1 如何快速的删除项目中的版本控制文件夹

 (1) 删除项目中的SVN文件夹。我们可以使用bat脚本来实现快速递归删除,代码如下:

@echo off

echo Deleting SVN folders and files under: %1

REM Open Folder specified by parameter.

cd %1

REM Recursive delete command

for /f "tokens=*" %%i in ('dir /b/a/s SVN*') do @rmdir /q /s "%%i"

echo Done!

 

 (2) 删除项目中的CVS文件夹。我们可以使用bat脚本来实现快速递归删除,代码如下:

@echo off

echo Deleting CVS folders and files under: %1

REM Open Folder specified by parameter.

cd %1

REM Recursive delete command

for /f "tokens=*" %%i in ('dir /b/a/s CVS*') do @rmdir /q /s "%%i"

echo Done!


2 如何去除项目文件夹及文件上的SVN图标

 虽然我们删除的项目文件里面的SVN文件夹,但是SVN的文件夹还显示在项目文件上,看起来很“尴尬”。怎么去除它呢?执行下面的代码即可:

@echo on   
color 2f   
mode con: cols=80 lines=25   
@REM   
@echo 正在清理SVN文件,请稍候......   
@rem 循环删除当前目录及子目录下所有的SVN文件   
@rem for /r . %%a in (.) do @if exist "%%a\.svn" @echo "%%a\.svn"   
@for /r . %%a in (.) do @if exist "%%a\.svn" rd /s /q "%%a\.svn"   
@echo 清理完毕!!!   
@pause