更改Mercurial“默认”父级URL

比方说,我有一个Mercurial存储库,我从一个默认的父URL(我从它克隆的源)。

现在我想更改默认的父URL(主机名更改,或者它被复制到另一台机器等)。 有没有办法做到这一点,或者我必须从新的URL重新克隆?

您甚至可以在.hg / hgrc文件的[paths]部分中添加多个条目。

[paths] default = /repo_store/hg/project1 sandbox = /repo_store/hg/project1_experimental 

然后可以在mercurial命令中指定它的别名。 默认回购不需要指定,但其他人必须像,

 hg in # check incoming changes from default repo hg in default # check incoming changes from default repo hg in sandbox # check incoming changes from sandbox repo hg pull sandbox # pull changes from sandbox repo 

我刚刚find了我自己的问题的答案。 编辑存储库中的.hg/hgrc文件,更改[paths]部分下的default设置。 简单!

为Mercurial推送和拉取设置默认BitBucket存储库的示例。

通常我们可以使用

 $ hg push https://bitbucket.org/username/com.example.app 

但是,如果我们想要使用$ hg push而不使用存储库URL,则必须将URL添加到$ REPO / .hg / hgrc文件中。 我们添加以下内容:

 [paths] default = https://bitbucket.org/username/com.example.app 

关于你的问题,只需将defaultpath设置为新的URL。