问题
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