“不可能只签出一个文件。你能做的最好的签出级别是在目录级别。”
在使用Subversion时,我如何解决这个问题?
我们在Subversion中有这个文件夹,用来保存所有的图像。我只是想从其中找出一个文件(图像)。这个文件夹真的很大,里面有很多我现在不需要的东西。
“不可能只签出一个文件。你能做的最好的签出级别是在目录级别。”
在使用Subversion时,我如何解决这个问题?
我们在Subversion中有这个文件夹,用来保存所有的图像。我只是想从其中找出一个文件(图像)。这个文件夹真的很大,里面有很多我现在不需要的东西。
当前回答
If you want to view readme.txt in your repository without checking it out: $ svn cat http://svn.red-bean.com/repos/test/readme.txt This is a README file. You should read this. Tip: If your working copy is out of date (or you have local modifications) and you want to see the HEAD revision of a file in your working copy, svn cat will automatically fetch the HEAD revision when you give it a path: $ cat foo.c This file is in my local working copy and has changes that I've made. $ svn cat foo.c Latest revision fresh from the repository!
源
其他回答
If you want to view readme.txt in your repository without checking it out: $ svn cat http://svn.red-bean.com/repos/test/readme.txt This is a README file. You should read this. Tip: If your working copy is out of date (or you have local modifications) and you want to see the HEAD revision of a file in your working copy, svn cat will automatically fetch the HEAD revision when you give it a path: $ cat foo.c This file is in my local working copy and has changes that I've made. $ svn cat foo.c Latest revision fresh from the repository!
源
我只需要浏览并导出单个文件。如果您有HTTP访问权限,只需使用web浏览器找到文件并获取它。
如果你在编辑后需要把它放回去,这可能会有点乏味,但我相信可能会有一个svn import函数……
请使用svn cat或svn export。
为此,您不需要获取工作目录,但您将无法提交所做的任何更改。如果您需要进行更改并提交它们,则需要一个工作目录,但不必完全获取它。检查目录仍然为/几乎为空的修订版,然后使用'svn cat'从HEAD中提取文件。
你可以这样做:
mkdir <your directory>/repos/test
svn cat http://svn.red-bean.com/repos/test/readme.txt > <your directory>/repos/test/readme.txt
基本上,这个想法是创建您想从SVN中获取文件的目录。 使用svn cat命令将输出重定向到同名文件。默认情况下,cat将在stdio上转储信息。
在Subversion 1.5中,可以检出目录中的(所有)文件,而无需检出任何子目录(各种——depth标志)。不是你想要的,而是一种“比所有都少”的形式。