如何使用Sharpsvn API检出存储库中的特定文件? [英] How to checkout a specific file in repository using sharpsvn API?

查看:134
本文介绍了如何使用Sharpsvn API检出存储库中的特定文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用SharpSvn API检出存储库中的特定文件或单个文件??

How to checkout a specific or a single file in repository using SharpSvn API????

推荐答案

Subversion不允许单独检出文件,因为最小的工作副本由目录组成.

Subversion doesn't allow checking out files by itself as the smallest working copy consists of a directory.

您可以做的等同于

svn co http://my.example/repository/subdir --depth empty F:\scratch-dir
svn up F:\scratch-dir\file</code></pre>

这将为您结帐 http://my.example/repository/subdir 作为F :\ scratch-dir \ file.这样可以更改文件并提交更改. (这可以在SharpSvn中使用SvnClient.CheckOut(),然后使用带有正确参数的SvnClient.Update()来实现)

This will give you a checkout of http://my.example/repository/subdir as F:\scratch-dir\file. This allows changing the file and committing changes to it. (This can be accomplished in SharpSvn by SvnClient.CheckOut() followed by SvnClient.Update() with the right arguments)

另一个选择是

svn cat http://my.example/repository/subdir/file > temp-file

这将为您提供文件的只读副本. (相当于SharpCvn的是SvnClient.Write().)

Which will give you a read only copy of the file. (The SharpSvn equivalent of this is SvnClient.Write().)

这篇关于如何使用Sharpsvn API检出存储库中的特定文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆