Linux 从 svn 存储库复制文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5183663/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-05 03:06:44  来源:igfitidea点击:

Copying files from svn repository

linuxsvncentos

提问by Mark Pegasov

I wanna copy files and folders from my svn repository on server, but I dont want to install svn client, can I do it without svn client?

我想从服务器上的 svn 存储库中复制文件和文件夹,但我不想安装 svn 客户端,我可以在没有 svn 客户端的情况下进行吗?

PS server - linux (CentOS 5.5), svnadmin version 1.4.2 (r22196)compiled Aug 10 2009, 17:54:46.

PS 服务器 - linux (CentOS 5.5), svnadmin version 1.4.2 (r22196) 编译于 2009 年 8 月 10 日,17:54:46。

UPD: files are already exported to server: I want to import files from svn repository to directory, where web-server runs. For example: svn repository located at /var/svn/repos, I wanna dump repository to /var/www, but in /var/svn/repos no files I needed.

UPD:文件已导出到服务器:我想将文件从 svn 存储库导入到运行 web 服务器的目录。例如:svn 存储库位于 /var/svn/repos,我想将存储库转储到 /var/www,但在 /var/svn/repos 中没有我需要的文件。

PSS sorry for my bad english =\

PSS 抱歉我的英语不好=\

采纳答案by David W.

The Subversion repository isn't in a readable format that you can peruse like you could with CVS. To read the files in the repository you need someone with a client somewhere.

Subversion 存储库不是一种您可以像使用 CVS 一样阅读的可读格式。要读取存储库中的文件,您需要有人在某处有客户。

If your Subversion repository uses Apache httpd for its server, you can use wgetor curlto pull off the last revision on a specific directory since as an added bonus, the Subversion Apache httpd modules allow you to see the latest version.

如果您的 Subversion 存储库使用 Apache httpd 作为其服务器,您可以使用wgetcurl取消特定目录上的最后一个修订版,因为作为额外的好处,Subversion Apache httpd 模块允许您查看最新版本。

$ wget http://svn/repos/foo/trunk/myfile.java

The other option is to use a Subversion repository browser like (ViewVC)[http://www.viewvc.org/] or Sventon. These will allow you to browse the entire repository (including older revisions) without having to install the Subversion client on the local machine. I like Sventon because it doesn't have to run from the Subversion repository server.

另一种选择是使用 Subversion 存储库浏览器,如 (ViewVC)[http://www.viewvc.org/] 或Sventon。这些将允许您浏览整个存储库(包括旧版本),而无需在本地计算机上安装 Subversion 客户端。我喜欢 Sventon,因为它不必从 Subversion 存储库服务器运行。

If you're on Centos 5.5, you should already have the Subversion command line client installed on your system. In that case, if you don't want the .svndirectories, use the svn exportcommand instead of svn checkout.

如果您使用的是 Centos 5.5,则您的系统上应该已经安装了 Subversion 命令行客户端。在这种情况下,如果您不需要.svn目录,请使用svn export命令而不是svn checkout.

Or, setup your web server to ignore the .svndirectories. That way, you can do an svn updateand update the files on your web server without having to redownload everything.

或者,设置您的 Web 服务器以忽略这些.svn目录。这样,您就可以执行svn update并更新 Web 服务器上的文件,而无需重新下载所有内容。

回答by Jeremy Whitlock

Well, if you have physical access to the server you could use the Subversion client on that box to export files/folders and then copy them from the server to the client machine. If you're trying to do this purely from the client, the only way I can think of would be to manually download the file(s) from the web client but this will only work if you're using Apache as your Subversion server.

好吧,如果您可以物理访问服务器,则可以使用该机器上的 Subversion 客户端导出文件/文件夹,然后将它们从服务器复制到客户端计算机。如果您试图完全从客户端执行此操作,我能想到的唯一方法是从 Web 客户端手动下载文件,但这只有在您使用 Apache 作为您的 Subversion 服务器时才有效。

回答by David Wolever

Unless the server has an HTTP interface (is the repository URL prefixed with http://? Just open it up in a web browser), no.

除非服务器有一个 HTTP 接口(存储库 URL 是否以http://?为前缀?只需在 Web 浏览器中打开它),不。

It might be simplest to export the files you want on the server (svn export file://repo/path/to/directory), then copy them to the client using http or scp or something.

将您想要的文件导出到服务器 ( svn export file://repo/path/to/directory)可能是最简单的,然后使用 http 或 scp 或其他方式将它们复制到客户端。