简体   繁体   English

如何使用应只读的GIT子模块提交hg repo?

[英]How to commit hg repo with GIT submodule which should be read only?

my Hg repo now needs to include a Git submodule (Restkit) as per the advised method in the site wiki. 根据站点Wiki中建议的方法,我的汞回购现在需要包含一个Git子模块(Restkit)。 However, I am not updating the git contents and should only be potentially reading/pulling in changes from the host. 但是,我没有更新git的内容,应该只可能从主机读取/拉动更改。 It appears that when I came to make my first push of my main Hg repo it baulked at the Git one asking for a password. 看来,当我来做我的主要Hg仓库的第一次推送时,它对Git迷了一下,要求输入密码。 I think this may be because its attempting to authenticate against the Git site as well. 我认为这可能是因为它也尝试针对Git站点进行身份验证。 My questions are can I arrange this so that the Git repo is read-only(pull) or even static and/or get round the log in issue. 我的问题是我可以安排它,以便Git存储库为只读(拉)或什至是静态的和/或绕过登录问题。 Obviously the two different repos have different credentials. 显然,这两个不同的存储库具有不同的凭据。 Thanks. 谢谢。 PS using Atlassian SourceTree 1.5.3 on OS X 10.8.2, Xcode 4.5.1 PS在OS X 10.8.2,Xcode 4.5.1上使用Atlassian SourceTree 1.5.3

I've just re-read this; 我只是重新阅读了一下;

2.6. 2.6。 Synchronizing in subrepositories 在子存储库中同步

Subrepos don't automatically track the latest changeset of their sources. Subrepos不会自动跟踪其源的最新变更集。 Instead, they are updated to the changeset that corresponds with the changeset checked out in the top-level changeset. 而是将它们更新为与顶级变更集中检出的变更集相对应的变更集。 This is so developers always get a consistent set of compatible code and libraries when they update. 这样一来,开发人员在更新时总是获得一致的兼容代码和库。

Thus, updating subrepos is a manual process. 因此,更新子存储库是一个手动过程。 Simply run 'hg pull' and 'hg up' in the target subrepo, test in the top-level repo, then commit in the top-level repo to record the new combination. 只需在目标子存储库中运行“ hg pull”和“ hg up”,在顶级存储库中进行测试,然后在顶级存储库中进行提交以记录新组合。 The onsub extension can be used to automate that. onsub扩展名可用于自动执行。

Assume this means its not pulling the sub? 假设这意味着它不拉子? but I still have the above issue of the password request. 但我仍然遇到上述密码询问问题。

You moved in the right direction, but not finished all required steps. 您朝正确的方向移动,但尚未完成所有必需的步骤。

You have to have subrepository , create it by hand... and don't mix real subrepository with a) independent b) nested repository 您必须具有子存储库 ,手动创建它...并且不要将真实的子 存储库a)独立的b)嵌套的存储库混合使用

When you'll convert nested to subrepo push into master repo will not perform push to subrepo (except it requested) 当您将嵌套的子仓库转换为推入主仓库时,将不会执行推入子仓库(除非请求)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM