仅查看 Mercurial 中的目录?

发布于 2024-08-18 13:38:59 字数 45 浏览 5 评论 0原文

如何仅从 Mercurial 存储库中查看子目录?看来我只能查看整个存储库。

How can i check out only a sub directory from mercurial repository? It seems i can only check out the whole repository.

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

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

发布评论

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

评论(4

节枝 2024-08-25 13:38:59

不,你不能。请参阅此处的讨论:

https://www.mercurial-scm.org/wiki/PartialClone

No, you cannot. See the discussion here:

https://www.mercurial-scm.org/wiki/PartialClone

晌融 2024-08-25 13:38:59

你做不到。该功能已计划,但尚未实施。前一个人提供了一个很好的链接,您可以在其中阅读有关部分克隆功能的讨论

现在,您应该非常小心地将内容分开,以便存储库是一个相当小的单元,在逻辑上可以作为一个整体进行管理。拥有 subrepos 的能力可能会帮助您组织和管理事物,直到该功能为止存在。

You can't do it. The feature is planned, but not implemented. The previous person gave a nice link to where you can read a discussion about the partial clone feature.

For now, you should just be really careful to divide things up so a repository is a fairly small unit that makes logical sense to manage in one piece. The existence of the ability to have subrepos might help you organize and manage things until that feature exists.

猥︴琐丶欲为 2024-08-25 13:38:59

下一个最好的事情是使用 Convert 扩展,如下所述:
https://www.mercurial-scm.org/wiki/ConvertExtension

过滤 Mercurial 存储库以获取现有存储库的子集也很有用。例如,要将存储库 foo 的子目录 subfoo 转换为具有自己生命周期的存储库(同时保留其完整历史记录),请执行以下操作:

echo include subfoo > /tmp/myfilemap
echo rename subfoo . >> /tmp/myfilemap
hg convert --filemap /tmp/myfilemap /path/to/repo/foo /tmp/mysubfoo-repo

The next best thing is using the Convert extension as discussed here:
https://www.mercurial-scm.org/wiki/ConvertExtension

It's also useful to filter Mercurial repositories to get subsets of an existing one. For example to transform a subdirectory subfoo of a repository foo into a repository with its own life (while keeping its full history), do the following:

echo include subfoo > /tmp/myfilemap
echo rename subfoo . >> /tmp/myfilemap
hg convert --filemap /tmp/myfilemap /path/to/repo/foo /tmp/mysubfoo-repo
淡淡離愁欲言轉身 2024-08-25 13:38:59

这是与 如何做相同的问题我在 Mercurial 中克隆了存储库的子文件夹? 所以那里和这里的答案将是相同的。我将总结它们:

尽管有术语(最初的问题只是询问“签出”,这只能在 Mercurial 中克隆后发生,但 Subversion 并没有真正的克隆概念),NarrowHG 解决方案可以说是最接近所需的解决方案。

This is the same question as How do I clone a sub-folder of a repository in Mercurial? so the answers there and here are going to be same. I'll summarize them:

Terminology notwithstanding (the original question was asking about only "check out" which can only happen after cloning in Mercurial but Subversion doesn't really have the concept of cloning) the NarrowHG solution is arguably the closest to what was desired.

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