如何使用 TortoiseSVN 仅签出(下拉)SVN 树的部分内容?

发布于 2024-08-09 18:21:42 字数 196 浏览 3 评论 0原文

我正在使用 TortoiseSVN,我想将现有存储库签出到本地目录中。但是,我只想拉下文件树的某些部分。我有办法做到这一点吗?

例如:

/trunk
    /project-A
    /project-B
    /project-C

假设我只想拉下主干、项目 A 和项目 B。我该怎么做?

I'm using TortoiseSVN and I want to do a Checkout of an existing repository into a local directory. However, I only want to pull down certain portions of the file tree. Is there a way I can do that?

For instance:

/trunk
    /project-A
    /project-B
    /project-C

Let's say I just want to pull down trunk, project-A and project-B. How do I do that?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

心房敞 2024-08-16 18:21:42

看起来您很成功,但我想提供一个分步指南,希望对其他人有帮助。

  1. trunk 检出到工作副本,深度 =“仅此项目”
  2. 打开工作副本
  3. 从工作副本转到存储库浏览器
  4. 选择所需的项目子文件夹,右键单击并选择“将项目更新到revision”

这只会将您选择的子文件夹拉入工作副本。

It looks like you were successful but I wanted to include a step-by-step guide in the hopes that it is helpful to others.

  1. Checkout trunk into a working copy with depth = "Only this item"
  2. Open working copy
  3. Go to repo browser from the working copy
  4. Select your desired project subfolder(s), right-click and select "Update item to revision"

This will pull only the subfolder(s) you've selected into your working copy.

泪冰清 2024-08-16 18:21:42

这可能会晚一些,但对于任何发现这个问题并想知道是否可以排除现有目录的人:似乎有一种方法可以做到这一点。

  1. 右键单击要排除的目录
  2. TortoiseSVN ->更新到修订版...
  3. 从“更新深度”下拉框中选择“排除”,然后按“确定”。

如果该目录没有任何本地 mod,则应该删除该目录,并将其从进一步的更新中排除。如果您需要恢复该目录,请使用上面的 Michael Hackner 的方法。

This may be coming late, but for anyone finding this question and wondering if you could exclude existing directories: there appears to be a way to do so.

  1. Right click on the directory you want to exclude
  2. TortoiseSVN -> Update To Revision...
  3. From the Update Depth drop-down box select Exclude and press OK

That should delete the directory if it doesn't have any local mods and exclude it from further updates. If you ever need the directory back, use Michael Hackner's method above.

想你的星星会说话 2024-08-16 18:21:42

从上面扩展自治的答案...

如果您已经签出整个项目,然后想要从中排除某些文件夹或文件....

  1. 右键单击包含要排除
  2. TortoiseSVN 的目录/文件的父目录 - >更新到修订...
  3. 从更新深度下拉框中选择排除,然后单击“选择项目...”并
    • 选择您想要保留的项目
    • 取消选择您想要排除的项目
    • 然后按“确定”再次确定

这应该会删除您取消选择的目录/文件,并将它们排除在进一步的更新之外。如果您需要恢复该目录,请重复该过程并更改您的选择。

Expanding on autonomy's answer from above ...

If you have checked out a whole project and later want to exclude certain folders or files from it....

  1. Right click on the parent directory that contains the dir/file you want to exclude
  2. TortoiseSVN -> Update To Revision...
  3. From the Update Depth drop-down box select Exclude and the click on "Choose items..." and
    • select the items you want to keep
    • and deselect the items you want to exclude
    • then press OK & OK again

That should delete the directories/files you have deselected and exclude them from further updates. If you ever need the directory back, repeat the process and change your selection.

玩世 2024-08-16 18:21:42

如果您进入project-A文件夹并右键单击==>SVN Update,它只会更新project-A文件夹及其子文件夹。然后你可以对项目B做同样的事情

If you go into the project-A folder and right-click==>SVN Update, it will only update the project-A folder and it's subfolders. Then you can do the same for project-B

暮光沉寂 2024-08-16 18:21:42

这也适用:

  1. 右键单击>选择 SVN 签出
  2. 选择“选择项目...”
  3. 选择您想要的子文件夹/项目 [1]

[1] - 请注意,如果您部分签出子文件夹(没有该子文件夹内的所有项目),文件随后会添加到该子文件夹中子文件夹并已提交,您在执行定期结帐时将不会获​​得它们。

此问题与您可以使用 Subversion 进行部分结账吗? 但具有使用 TortoiseSVN 的特定上下文。

This works as well:

  1. Right click > Select SVN Checkout
  2. Select "Choose items..."
  3. Select the subfolders/items you want [1]

[1] - Do note that if you checkout subfolders partially (without all the items inside that subfolder), and files are subsequently added to that subfolder and committed, you will not get them when you perform a regular checkout.

This question is related to Can you do a partial checkout with Subversion? but with a particular context of using TortoiseSVN.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文