Search code examples
gitgithubmercurialhg-git

Problems uploading a mercurial repository to github using hg-git


I have hg-git installed, and a mercurial repository, and I want to upload it to github. I've created a project and am in the "quick setup" phase where I get URIs I can use:

https://github.com/eyalroz/usdt-ontime.git
git@github.com:eyalroz/usdt-ontime.git

So, the first thing I tried is editing .hg/hgrc in my mercurial repository and adding

[paths]
default = git+ssh://git@github.com/eyalroz/usdt-ontime.git

and added a master bookmark:

hg bookmark -r default master # so a ref gets created

as per the instructions here. Then I tried to push, and failed:

$ hg push
pushing to git+ssh://git@github.com/eyalroz/usdt-ontime.git
abort: repository git+ssh://git@github.com/eyalroz/usdt-ontime.git not found!

What am I doing wrong?


Solution

  • It seems your .hgrc file should contain:

    [extensions]
    hgext.bookmarks =
    hggit =
    

    (which probably enables these two and sets them to their default value) for hg-git functionality to actually work.