导出一个Subversion工作副本

Sometimes you may want a clean copy of your working tree without the .svn directory, e.g. to create a zipped tarball of your source, or to export to a web server. Instead of making a copy and then deleting the .svn directory manually, TortoiseSVN offers the command TortoiseSVN → Export…. Exporting from a URL and exporting from a working copy are treated slightly differently.

图 4.66. 从 URL 导出对话框

从 URL 导出对话框

如果你在未版本控制的目录执行此命令,TortoiseSVN会假定此目录是目标,弹出对话框让你输入要导出的URL和版本。这个对话框有只导出顶级目录,省略外部引用,以及不管svn:eol-style的取值,重新设置行结束样式等选项。

当然,你也可以直接从版本库导出。使用版本库浏览器浏览有关子树,然后使用右键菜单 → 导出。就会出现上面所说的从URL导出对话框。

If you execute this command on your working copy you'll be asked for a place to save the clean working copy without the .svn folder. By default, only the versioned files are exported, but you can use the Export unversioned files too checkbox to include any other unversioned files which exist in your WC and not in the repository. External references using svn:externals can be omitted if required.

Another way to export from a working copy is to right drag the working copy folder to another location and choose Context Menu → SVN Export versioned items here or Context Menu → SVN Export all items here or Context Menu → SVN Export changed items here. The second option includes the unversioned files as well. The third option exports only modified items, but maintains the folder structure.

当从一个工作副本导出时,如果目标文件夹已包含了与您所导出的具有相同名称的文件夹,将为您提供此选项来重写现有内容,或者创建一个自动生成名称的新文件夹,例如 目标 (1)

导出单个的文件

导出对话框不允许展出一个单独的文件,尽管 Subversion 可以

要用 TortoiseSVN 导出单个文件,您必须使用版本库浏览器 (“版本库浏览器”一节)。简单地将您想从版本库浏览器中导出的文件拖动到想要存放至的资源管理器位置,或者使用版本库浏览器的上下文菜单来导出文件。

导出更改树

如果您想导出项目树结构的副本,但只包含在某特定修订版本中或任意两个修订版本之间发生更改的文件,请使用在 “比较文件夹”一节

If you want to export your working copy tree structure but containing only the files which are locally modified, refer to SVN Export changed items here above.

从版本控制里移除删除工作副本

Sometimes you have a working copy which you want to convert back to a normal folder without the .svn directory. All you need to do is delete the .svn directory from the working copy root.

Alternatively you can export the folder to itself. In Windows Explorer right drag the working copy root folder from the file pane onto itself in the folder pane. TortoiseSVN detects this special case and asks if you want to make the working copy unversioned. If you answer yes the control directory will be removed and you will have a plain, unversioned directory tree.