Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
更改Mercurial“;“违约”;父URL_Mercurial - Fatal编程技术网

更改Mercurial“;“违约”;父URL

更改Mercurial“;“违约”;父URL,mercurial,Mercurial,假设我有一个Mercurial存储库,我从一个默认的父URL(我从中克隆它的源)提取 现在我想更改默认的父URL(主机名更改,或者它被复制到另一台机器上,等等)。有没有办法做到这一点,或者我必须从新的URL重新克隆?我刚刚找到了我自己问题的答案。编辑存储库中的.hg/hgrc文件,更改[path]部分下的默认设置。简单 您甚至可以在.hg/hgrc文件的[path]部分添加多个条目 [paths] default = /repo_store/hg/project1 sandbox = /repo

假设我有一个Mercurial存储库,我从一个默认的父URL(我从中克隆它的源)提取


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

我刚刚找到了我自己问题的答案。编辑存储库中的
.hg/hgrc
文件,更改
[path]
部分下的
默认设置。简单

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

[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
为Mercurial push and pull设置默认BitBucket存储库的示例。 通常我们可以使用

$ hg push https://bitbucket.org/username/com.example.app
但是如果我们想在不使用存储库URL的情况下使用
$hg push
,我们必须将URL添加到文件$REPO/.hg/hgrc中。我们增加了以下内容:

[paths]
default = https://bitbucket.org/username/com.example.app
关于您的问题,只需将
默认路径设置为新URL