2007-05-24

 

删除.svn目录

很多时候,需要删除SVN工作目录下的.svn目录,常用的作法是用系统(Windows)自带的搜索功能,搜索出所有.svn目录(需要在"其他高级选项"中选中"搜索隐藏的文件和文件夹"),然后全选删除。这当然不是高效的作法,谁能忍受一遍又一遍重复这种纯体力的劳动?

Jon Galloway提供了一段注册表代码,可以将"Delete SVN Folders"命名增加到资源管理器的右键上,这样,鼠标点两下就能把选中目录下的所有.svn目录干掉了。Works just great!

代码为:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteSVN]
@="Delete SVN Folders "

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteSVN\command]
@="cmd.exe /c \"TITLE Removing SVN Folders in %1 && COLOR 9A && FOR /r \"%1\" %%f IN (.svn) DO RD /s /q \"%%f\" \" "

将这段代码保存为一个.reg文件,双击确认导入注册表即可。

出自: Jon Galloway : Shell Command - Remove SVN Folders

Shell Command - Remove SVN Folders

The Subversion source control client maintains your local state in hidden folders named .svn inside your project, which can be a problem if you want to copy or share the project directory.  This REG file adds "Delete SVN Folders" to the context menu for folders. When you select it, it removes all folders named .svn inside the folder and it's children (it does nothing if the project's not under Subversion source control.

I'm not going to bother explaining reg file installation here - I figure if you're using SVN, you're good with reg files.


Comments: 发表评论



<< Home

This page is powered by Blogger. Isn't yours?