如何跳过 tortoise hg 中的子存储库
我正在使用 tortoise hg,我的存储库包含子存储库。子存储库非常大,更新需要很长时间。
有没有办法更新我的存储库但跳过更新子存储库?
I am using tortoise hg and my repository contains subrepo. The subrepo is very large and takes really really long time to update.
Is there a way to update my repository but skip updating the subrepo?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
update
命令旨在始终对整个存储库进行操作。没有排除子存储库的选项。但是,如果您正确构建存储库,您应该能够实现您所需要的。
我预计您会遇到这个问题,因为您的项目存储库如下所示:
使用上述结构,
update
被迫对您控制下的两个文件(在parent
中)进行操作)以及您的子存储库。构建存储库的更好(也更灵活)的方法是:使用此结构,您可以更新
your_repo
而无需更新您所依赖的库。The
update
command is intended to always operate on the entire repository. There is no option to exclude a subrepo.However if you structure your repository correctly, you should be able to achieve what you need.
I expect that you run into this problem because your project repo looks like this:
With the above structure,
update
is forced to operate on both the files under your control (inparent
) and also your subrepo. A better (and more flexible) way to structure your repository is this:With this structure, you could update
your_repo
without requiring an update to the libraries you depend on.这是我使用的一个技巧:
在另一个文件夹中拥有子存储库的本地存储库。我从同事那里复制了该文件夹。
设置新的存储库。拉取更改(暂不更新)。将本地子存储库克隆到新存储库中的适当位置。现在更新和 tortoiseHg 将仅获取该子存储库中的差异。
此时,您的子存储库指向本地副本。一旦一切都更新为最新。将子存储库指向远程服务器中的子存储库。
当然,只有当您或某人已经拥有子存储库的副本时,这才有效。
Here is a trick that I use:
Have a local repository of the subrepo in ANOTHER folder. I copied the folder from a colleague of mine.
Setup new repo. Pull the changes (don't update yet). CLONE the local subrepo into the appropriate location in the new repo. Now update and tortoiseHg will only fetch the diff in that subrepo.
At this point, your subrepo points to the local copy. Once everything is update-to-date. Point the subrepo to the one in remote server.
Of course, this only works if you or somebody already has a copy of the subrepo.