简体   繁体   English

如何从 SVN 存储库中检出单个文件(不是文件夹)?

[英]How do I checkout a single file (not folder) from the SVN repository?

Currently I am working on a C#.net project (visual studio 2005).目前我正在开发一个 C#.net 项目(visual studio 2005)。 I could checkout a project from the SVN repository, make changes to a file and commit.我可以从 SVN 存储库中签出一个项目,对文件进行更改并提交。

But, how can I specify the checkout depth (sparse checkout) and checkout a single file by using sharpSVN DLL?但是,如何使用sharpSVN DLL 指定检出深度(稀疏检出)并检出单个文件? Please help.请帮忙。

Subversion clients do not, so far as I know, generally support single-file checkouts.据我所知,Subversion 客户端通常不支持单文件检出。 You can certainly get a single file (with nothing more than a simple HTTP GET request to the URL), but checking back in changes will be more difficult.你当然可以得到一个文件(只不过是一个简单的 HTTP GET 请求到 URL),但是检查更改会更加困难。

The reason for this is that Subversion wants to create its metadata directories ( .svn ) to track properties, URLs, the old version of the file, etc. That's hard to do in a single file.这样做的原因是 Subversion 想要创建它的元数据目录( .svn )来跟踪属性、URL、文件的旧版本等。这在单个文件中很难做到。

Like @derobert said, you cannot check out a single file.就像@derobert 所说,您不能签出单个文件。 The best you can do is a non-recursive checkout of that file's directory.您能做的最好的事情是对该文件的目录进行非递归检出。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM