How to checkout a specific file in repository using sharpsvn API?

和自甴很熟 提交于 2019-12-13 04:06:51

问题


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


回答1:


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

What you could do is the equivalent of

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

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)

Another option is

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

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



来源:https://stackoverflow.com/questions/12614627/how-to-checkout-a-specific-file-in-repository-using-sharpsvn-api

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!