5

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.

john2x
  • 22,546
  • 16
  • 57
  • 95

1 Answers1

12

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:

[paths]
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.

Lasse V. Karlsen
  • 380,855
  • 102
  • 628
  • 825
  • Is it possible to push to several remote repos simultaneously with one command? I'm just wondering if it possible :) – Dmitrii Lobanov Apr 02 '11 at 17:01
  • @Dmitry: This is possible using [hooks](http://www.selenic.com/mercurial/hgrc.5.html#hooks). A `post-push` hook would fit for that purpose. – Oben Sonne Apr 02 '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. – Dmitrii Lobanov Apr 04 '11 at 17:42