2

I don't necessarily have a preference for either Git or Mercurial. I have both of them installed and find them equally difficult to get my head around. I mainly use Mercurial because our repositories live in Kiln.

I just cloned a project from GitHub using Hg and Hg-Git. I want to pull and merge changes from GitHub to my local repository, but I want to push changes from my local hg repository to Kiln.

Can this be done or is the connection to GitHub lost once it's converted to Hg?

ATL_DEV
  • 9,256
  • 11
  • 60
  • 102
  • What is your question? Have you tried to `hg push http://path/to/kiln`? If that is all you want to do, then you can set `default-push` in your `.hg\hgrc` file to automatically push to Kiln as well. See `hg help config` for details on `default-push`. – Tim Henigan Oct 09 '12 at 16:46
  • Thanks. I clarified my question to the best of my abilities. You almost answered my question, but will I be able to pull changes from Github or is the link lost? – ATL_DEV Oct 09 '12 at 17:38
  • I've just written a script to keep some GitHub and Kiln repos in sync. I can't answer here, but you can see the script in another answer here: http://stackoverflow.com/a/15370481/25124 – Danny Tuppeny Mar 12 '13 at 19:33

1 Answers1

4

When you clone a project in Mercurial, the path that you cloned from is set as the default. Both push and pull will use this path if none other is specified on the command-line.

If you want your push and pull URLs to be different, put the following inside your <repo>\.hg\hgrc:

[paths]
default = http://path/to/pull/repo
default-push = http://path/to/push/repo

With these set

  • hg pull will automatically pull from default
  • hg push will automatically push to default-push

See hg help urls for details.

Tim Henigan
  • 60,452
  • 11
  • 85
  • 78