Take the 2-minute tour ×

I just installed Hg-Git and I was wondering if it is possible to push to both Bitbucket.org and Github.com from the same repository. I'm thinking of something like:

$ #make commits
$ hg push #pushes to Bitbucket since it is set as `default` in hgrc
$ hg push "github remote alias" #push to Github

So, by default it pushes to Bitbucket, and to push to Github by specifying a "remote" alias.

share|improve this question
Have you tried it? –  Lasse V. Karlsen Apr 2 '11 at 15:07
I haven't tried it. Does Hg have a remote add command to try this? –  john2x Apr 2 '11 at 15:37
I'm a bit confused. Are you asking how to make the push command push to multiple remote destinations? –  Lasse V. Karlsen Apr 2 '11 at 15:59
See the second exercise here: mercurial.aragost.com/kick-start/en/basic/#id4 –  Martin Geisler Apr 6 '11 at 13:13
add comment

1 Answer

up vote 11 down vote accepted

If your question is how to make hg push able to push to multiple remote destinations, one by default and one named, then that's easy.

You edit the .hg\hgrc file in your repository and add/modify:

default = https://hg01.codeplex.com/mercurialnet
kiln = https://lassevk.kilnhg.com/Repo/Mercurial-Net/dev/trunk/

The above is my setting for one of my projects. By default, ie. just hg push it pushes to CodePlex, but I can also ask it to push to kiln by executing hg push kiln.

The one named default is basically the one used if you don't specify the alias for a remote destinations, and you can have 0 or more named ones in addition to default.

If that was not your question, please elaborate.

share|improve this answer
Is it possible to push to several remote repos simultaneously with one command? I'm just wondering if it possible :) –  Dmitry Lobanov Apr 2 '11 at 17:01
@Dmitry: This is possible using hooks. A post-push hook would fit for that purpose. –  Oben Sonne Apr 2 '11 at 19:21
@Oben: Thanks for the answer. I'm aware of hooks feature, and I was wondering if it is possible to do without hooks. –  Dmitry Lobanov Apr 4 '11 at 17:42
add comment

Your Answer


