我已经fork了一个Mercurial仓库,现在想要将主仓库的更改拉取到我的fork中。如果这是git,我会做类似于这样的操作...
git remote add upstream <url>
git pull upstream master
我该如何在Mercurial中做这种事情?
我已经fork了一个Mercurial仓库,现在想要将主仓库的更改拉取到我的fork中。如果这是git,我会做类似于这样的操作...
git remote add upstream <url>
git pull upstream master
我该如何在Mercurial中做这种事情?
你也可以修改你本地仓库的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
default-push = ssh://hg@bitbucket.org/<my_user>/<my_repo>
default = ssh://hg@bitbucket.org/<other_user>/<other_repo>
然后你可以使用以下命令从上游(也称为默认)拉取代码:
hg pull
并使用以下命令将更改推送到 fork (默认推送):
hg push
<my_repo>
进行更改,这不会出现问题吗?这只适用于单用户存储库,我是对的吗? - Jonathan