Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a Git command to import a hg repository

Tags:

git

mercurial

With git svn clone I can work on a subversion repository using git. Is there a similar way to work on Mercurial (hg) repositories?

like image 338
Jesper Rønn-Jensen Avatar asked Mar 07 '11 21:03

Jesper Rønn-Jensen


People also ask

What is Hg in Git?

The Hg-Git plugin can convert commits/changesets losslessly from one system to another, so you can push via a Mercurial repository and another Mercurial client can pull it. In theory, the changeset IDs should not change, although this may not hold true for complex histories. Commands.

Does GitHub work with Mercurial?

hg-github is a Mercurial extension that wraps hg-git, and supports a work-flow where repositories are hosted on Bitbucket and mirrored on GitHub. This work-flow normally requires adding Git paths to each repository's config file, and creating Mercurial bookmarks pointing to the GitHub repository's branch name.


2 Answers

There isn't anything built in.

You can use git-hg however, which I use a lot and works great for pulling hg repos and updates to a git repo, but the downside of it is that you cannot push updates made to your git repo to a hg repo with git-hg.

like image 192
erikvold Avatar answered Oct 19 '22 12:10

erikvold


The Mercurial extension hg-git is another way to go in the Hg->Git direction. If you just want to go in that direction, so far as I can see, it and git-hg both work well. More details here.

like image 43
dubiousjim Avatar answered Oct 19 '22 11:10

dubiousjim