开发者

How to pull in upstream changes into a fork using Mercurial?

I've forked a Mercurial repository, and now I want to pull the changes from the main repository into my fork. If this were git, I would do something like...

git remote add upstream <url>
git pull upstream master

How do I do this sort of thing in 开发者_如何学编程Mercurial?


You could also modify your hgrc file in your repo

default = ssh://hg@bitbucket.org/<my_user>/<my_repo>
upstream = ssh://hg@bitbucket.org/<other_user>/<other_repo>

Then you can do

hg pull upstream


If you cloned the repository from the one you want to pull changes from, you can simply do:

hg pull

If you cloned the repository from another repository, you can:

hg pull <location of repository to pull from>

You'll then need to update your working copy:

hg update

That's the basics, anyway. More details are available in the Mercurial: The Definitive Guide


Have you tried the pull command?

hg pull http://master.com/master

If that does not work, please elaborate.


You could also modify your hgrc file in your repo to use the special path names default and default-push.

default-push = ssh://hg@bitbucket.org/<my_user>/<my_repo>
default = ssh://hg@bitbucket.org/<other_user>/<other_repo>

Then you can pull from upstream (aka default) with

hg pull

and push to fork (aka default-push) with

hg push
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜