# HG changeset patch # User Simon Ruderich <simon@ruderich.org> # Date 1270567213 18000 # Tue Apr 06 10:20:13 2010 -0500 # Node ID 3ab3765db5bc8bf6be62c0de93a10b765e4fd0bb # Parent f4a125201c5cebb6d79351b69f07a3e8425cf4f8 README.md: Improve Mercurial to Git conversion description. diff --git a/README.md b/README.md --- a/README.md +++ b/README.md @@ -41,21 +41,20 @@ That will pull down any commits that have been pushed to the server in the meantime and give you a new head that you can merge in. -Hg-Git can also be used to convert a Mercurial repository to Git. As Dulwich doesn't support local repositories yet, the easiest way is to setup up a local SSH server. Then use the following commands to convert the repository. +Hg-Git can also be used to convert a Mercurial repository to Git. As Dulwich doesn't support local repositories yet, the easiest way is to setup up a local SSH server. Then use the following commands to convert the repository (it assumes your running this in $HOME). $ mkdir git-repo; cd git-repo; git init; cd .. $ cd hg-repo - $ hg push git+ssh://localhost/absolute/path/to/git-repo + $ hg bookmarks hg + $ hg push git+ssh://localhost:git-repo -To import new changesets into the Git repository you can run the last command as often as you want, only new changes will be pushed. - -If the you get the following warning you should setup a bookmark so Git doesn't have to push to the currently checked out branch. +The hg bookmark is necessary to prevent problems as otherwise hg-git pushes to the currently checked out branch confusing Git. This will create a branch named hg in the Git repository. To get the changes in master use the following command (only necessary in the first run, later just use git merge or rebase). - warning: updating the current branch + $ cd git-repo + $ git checkout -b master hg -To fix this run the following command in the Git repository. Warning: All local changes are destroyed! +To import new changesets into the Git repository just rerun the hg push command and then use git merge or git rebase in your Git repository. - $ git reset --hard Hg Bookmarks Integration ========================