Mercurial 提交子文件夹中的子存储库

标签 mercurial mercurial-commit

我有文件/目录结构:

main/.hg
main/subrepo/.hg
main/subrepo1/.hg

我有包含此类内容的 .hgignore 文件

.hg

最后,我想在“主”存储库中进行提交,其中将包含其中的所有文件,包括 main/subrepo 和 main/subrepo1 中的所有文件,但不包括文件夹 main/subrepo/.hg 和 main/subrepo1/。 hg (因此主文件夹中的所有文件,不包括其中的 .hg 文件夹)。但 Mercurial 会跳过 main/subrepo/* 和 main/subrepo1/*。它不包括要完全提交的子文件夹/子存储库。我该如何解决这个问题?

最佳答案

我猜测您只是创建了一些嵌套存储库,但没有将它们正确链接为子存储库。

确保main存储库的根目录中有一个名为.hgsub的文件。您创建文件,添加以下内容,然后将文件添加并提交到主存储库:

subrepo = https://path-to-subrepo/
subrepo1 = https://path-to-subrepo1

如果子存储库没有指向某个远程服务器,您当然会使用本地路径。

关于Mercurial 提交子文件夹中的子存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20577219/

相关文章:

version-control - merge 选定的更改

mercurial - Mercurial 变更集到底是什么?

Mercurial:如何修改最后一次提交?

Mercurial 仅提交提示

mercurial - 在 rebase 后拉取 repo 上的提交

mercurial - 与远程 Mercurial 存储库保持同步的正确(最佳实践?)程序?

Mercurial 和 NTFS 备用数据流

Mercurial 撤消最后一次提交

mercurial - 如何在 TortoiseHg Workbench 中查看 Mercurial 提交消息的完整文本