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条回答
Lonely孤独者°
2楼-- · 2019-01-03 12:04

Try svn export.

You should be able to do something like this:

svn export /path/to/old/working/copy /path/to/plain/code

And then just delete the old working copy.

TortoiseSVN also has an export feature, which behaves the same way.

查看更多
一夜七次
3楼-- · 2019-01-03 12:05

The answer is surprisingly simple - export the folder to itself! TortoiseSVN detects this special case and asks if you want to make the working copy unversioned. If you answer yes the control directories will be removed and you will have a plain, unversioned directory tree.

查看更多
Fickle 薄情
4楼-- · 2019-01-03 12:07

Another (simpler) Linux solution:

rm -r `find /path/to/foo -name .svn`
查看更多
Fickle 薄情
5楼-- · 2019-01-03 12:08

NetBeans IDE users can do it as below:

  1. Open the SVN project in your IDE
  2. Select the project

    right click Subversion Export

  3. In the dialog box

    export to folder /var/tmp/projectname press export wait will show complete will ask do you want to open it do open on the fly

  4. You can now switch to Git :)

查看更多
祖国的老花朵
6楼-- · 2019-01-03 12:09

On Windows 7 one can just open the project folder and do a search for ".svn" if hidden files are enabled and delete all found .svn folders.

查看更多
一纸荒年 Trace。
7楼-- · 2019-01-03 12:11

On Linux, this will work:

  find . -iname ".svn" -print0 | xargs -0 rm -r
查看更多
登录 后发表回答