How do you remove Subversion control for a folder?

2019-01-03 11:30发布

I have a folder, c:\websites\test, and it contains folders and files that were checked out from a repository that no longer exists. How do I get Subversion to stop tracking that folder and any of the subfolders and files?

I know I could simply delete the .svn folder, but there are a lot of sub-folders in many layers.

标签: svn
27条回答
ら.Afraid
2楼-- · 2019-01-03 12:19

On Windows, you can add a quicklink for that to your explorer right click menu. Just start this registry script:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Folder\shell\DeleteSVN]
@="Delete SVN Folders"

[HKEY_CLASSES_ROOT\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\" \""

This will add an item called "Delete SVN Folders" to your right click menu. This will delete all .svn folders in this folder and all subfolders.

Source (German): http://www.sjmp.de/software/alle-svn-ordner-und-dateien-loeschen/

查看更多
老娘就宠你
3楼-- · 2019-01-03 12:19

For those using NetBeans with SVN, there is an option 'Subversion > Export'.

查看更多
放我归山
4楼-- · 2019-01-03 12:23

On Linux the command is:

svn delete --keep-local file_name
查看更多
祖国的老花朵
5楼-- · 2019-01-03 12:23

You can use "svn export" for creating a copy of that folder without svn data, or you can add that folder to ignore list

查看更多
欢心
6楼-- · 2019-01-03 12:24

Also, if you are using TortoiseSVN, just export to the current working copy location and it will remove the .svn folders and files.

http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-export.html#tsvn-dug-export-unversion

Updated Answer for Subversion 1.7:
In Subversion 1.7 the working copy has been revised extensively. There is only one .svn folder, located in the base of the working copy. If you are using 1.7, then just deleting the .svn folder and its contents is an easy solution (regardless of using TortoiseSVN or command line tools).

查看更多
小情绪 Triste *
7楼-- · 2019-01-03 12:24

There's also a nice little open source tool called SVN Cleaner which adds three options to the Windows Explorer Context Menu:

  • Remove All .svn
  • Remove All But Root .svn
  • Remove Local Repo Files
查看更多
登录 后发表回答