在mercurial中更改子存储库URL,从https更改为ssh。这样做有什么问题吗?

时间:2011-03-29 03:40:43

标签: mercurial ssh subrepos mercurial-subrepos

我在.hgsub中有一个子存储库的条目,使用https调用。

myrepo = https://user@bitbucket.org/user/project

现在,我想使用ssh,因为两个存储库都是我的,我已经创建了一个ssh密钥。所以,它将是:

myrepo = ssh://hg@bitbucket.org/user/project

我没有改变,也没有测试过。有人知道更改此网址是否会增加某种问题?

1 个答案:

答案 0 :(得分:1)

只要你有一个密码或公钥/私钥组合用于ssh就可以了,因为它符合这里的示例语法:https://www.mercurial-scm.org/wiki/QuickStart

但是,您也可以执行以下操作:

ssh://user@website.org//absolute/path/to/repo

当我将项目推送/拉到我的家庭服务器时,这就是我的.hg / hgrc中的内容(如果你在两台机器上都有相同的用户名,则可以取消用户@)。