如何在不检出整个源代码的情况下仅检出几个文件和文件夹 [英] How to checkout few files and folders alone without checking out entire source

查看:135
本文介绍了如何在不检出整个源代码的情况下仅检出几个文件和文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的项目中,我有很多文件夹.我当然知道我只希望更改几个文件(大约15个文件),每个文件都位于7个不同的文件夹中.另外,我不想签出整个源来完成它.是否可以仅仅签出所需的文件夹?

In my project I have many folders. I certainly know I want have changes in only few files (around 15) each of them are in 7 different folders. Also, I don't want to checkout the entire source to accomplish it. Is it possible to checkout only the required folders alone?

对于不同的来源,我经常遇到这种情况.可以一次只签出选定的文件夹吗?

I'll have this scenario too often for different sources. Is it possible to checkout only selected folders at one shot?

修改

例如,我有一个包含源文件夹. 5个子文件夹.喜欢,

Say for example I have a source folder contains. 5 sub-folders. Like,

-核心

-助手

-扩展

-主题

-资源

而且,我想单独检出Extensions和Themes文件夹.但是,我不想分别检出每个文件夹.我想要这样,我将退房位置定为svn.svnhost.com/trunk/project1/source. [然后,我选择ExtensionsThemes进行一次结帐]

And, I want to check-out Extensions and Themes folders alone. But, I don't want to check-out each of the folders separately. I want it like, I'll give the check-out location as svn.svnhost.com/trunk/project1/source. [Then, I'll select Extensions and Themes give a single check-out]

预期结帐:

-扩展

-主题

类似:

svn co svn.svnhost.com/trunk/project1/source --foldernames Extensions, Themes

推荐答案

Subversion 1.7除了仅签出您想要的文件夹(仅当您还需要整个子文件夹树时才有效),Subversion 1.7支持称为"稀疏目录".基本上,您可以将文件夹检出一定深度,然后再向下钻取"到您感兴趣的文件夹中.

Apart from just checking out the folders you want (which only works if you want the entire subfolder tree as well), Subversion 1.7 supports something referred to as "sparse directories". Basically you can checkout a folder to a certain depth, and then afterwards "drill down" into the folders you are interested in.

使用命令行客户端,对svn update使用--depth--set-depth选项.如果您使用的是TortoiseSVN,则在签出对话框中有一个签出深度"选项.

Using the command line client, you use the --depth and --set-depth options to svn update. If you are using TortoiseSVN, there is a "Checkout Depth" option in the checkout dialog.

编辑:要针对您的特定问题进行澄清,您首先要对源目录树进行立即"深度的检出.这将为您提供所有文件夹,但最初它们将为空.然后,您可以通过将它们更新为完全递归"的深度(svn update --set-depth infinity或在TortoiseSVN更新至修订版→更新深度&rarr"中,在扩展主题目录中进行深入研究. ;完全递归").

EDIT: To clarify against your specific question, you would first to a checkout of your source tree with depth "immediates". This will give you all your folders, but they will initially be empty. Then you can drill down in the Extensions and Themes directories by updating them to "fully recursive" depth (svn update --set-depth infinity or in TortoiseSVN "Update to revision → Update Depth → "Fully Recursive").

编辑:更新深度可以看作是一种可见性级别",Subversion可以记住该深度,即,如果在工作副本上执行svn update,则只会更新到当前的可见度级别.

EDIT: The update depth can be seen as a sort of "visibility level", and is remembered by Subversion, i.e. if you do a svn update on your working copy, it will only update to the current visibility level.

这篇关于如何在不检出整个源代码的情况下仅检出几个文件和文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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