Reputation: 4069
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?
Upvotes: 36
Views: 7887
Reputation: 309
You could also modify your hgrc file in your repo to use the special path names default and default-push.
default-push = ssh://[email protected]/<my_user>/<my_repo>
default = ssh://[email protected]/<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
Upvotes: 3
Reputation: 901
You could also modify your hgrc file in your repo
default = ssh://[email protected]/<my_user>/<my_repo>
upstream = ssh://[email protected]/<other_user>/<other_repo>
Then you can do
hg pull upstream
Upvotes: 50
Reputation: 7349
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
Upvotes: 28
Reputation: 262474
Have you tried the pull command?
hg pull http://master.com/master
If that does not work, please elaborate.
Upvotes: 4