【发布时间】:2010-04-21 00:31:48
【问题描述】:
我已经 fork 了一个 Mercurial 存储库,现在我想将更改从主存储库拉到我的 fork 中。如果这是 git,我会做类似...
git remote add upstream <url>
git pull upstream master
我如何在 Mercurial 中做这种事情?
【问题讨论】:
标签: mercurial
我已经 fork 了一个 Mercurial 存储库,现在我想将更改从主存储库拉到我的 fork 中。如果这是 git,我会做类似...
git remote add upstream <url>
git pull upstream master
我如何在 Mercurial 中做这种事情?
【问题讨论】:
标签: mercurial
你也可以在你的 repo 中修改你的 hgrc 文件
default = ssh://hg@bitbucket.org/<my_user>/<my_repo>
upstream = ssh://hg@bitbucket.org/<other_user>/<other_repo>
那你就可以了
hg pull upstream
【讨论】:
如果您从要从中提取更改的存储库中克隆了存储库,您只需执行以下操作:
hg pull
如果您从另一个存储库克隆了该存储库,您可以:
hg pull <location of repository to pull from>
然后您需要更新您的工作副本:
hg update
无论如何,这就是基础。更多详细信息,请访问Mercurial: The Definitive Guide
【讨论】:
你试过拉命令吗?
hg pull http://master.com/master
如果这不起作用,请详细说明。
【讨论】:
您还可以修改您的 repo 中的 hgrc 文件以使用特殊路径名 default 和 default-push。
default-push = ssh://hg@bitbucket.org/<my_user>/<my_repo>
default = ssh://hg@bitbucket.org/<other_user>/<other_repo>
然后你可以从上游(又名默认)拉
hg pull
并使用
推送到分叉(又名默认推送)hg push
【讨论】:
<my_repo> 进行更改,这不会中断吗?这仅适用于单用户回购,对吗?