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

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

问题描述

在我的项目中,我有很多文件夹.我当然知道我只想对少数文件(大约 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 支持称为稀疏目录".基本上你可以检出一个文件夹到一定深度,然后深入"到你感兴趣的文件夹.

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.

使用命令行客户端,您可以使用--depth--set-depth 选项来svn update.如果您使用的是 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.

编辑:为了澄清您的具体问题,您首先要检查具有立即数"深度的源树.这将为您提供所有文件夹,但它们最初是空的.然后,您可以通过将 ExtensionsThemes 目录更新为完全递归"深度(svn update --set-depth infinity或在 TortoiseSVN 中更新到修订版 → 更新深度 →完全递归").

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").

EDIT:更新深度可以被看作是一种可见性级别",并且会被 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天全站免登陆