Migrating from Mercurial to Git

I know that this question has been asked several times and is marked as a โ€œpossible duplicate,โ€ but none of them work correctly. I tried a quick export and this gives an error. Can anyone help How to port from Mercurial to Git? I need a story. It would be clear if it would be indicated step by step.

UPDATE:

I tried a quick export:

cd ~ git clone git://repo.or.cz/fast-export.git git init git_repo cd git_repo ~/fast-export/hg-fast-export.sh -r /path/to/old/mercurial_repo **[I get error in this line]** git checkout HEAD 

this gives an error:

..... hg-fast-export.sh: line 79: python: command not found

Thanks for the help!

+4
source share
1 answer
  • Add hg-git to Mercurial
  • Press hg-repo on git-target

Walkthrough

A Clone Hg-git An extension from this repository to some local PATH \ TO \ HG-GIT

B Include the extension in (global mercurial.ini or a specific .hgrc repository)

 [extensions] bookmarks = ... hggit = PATH\TO\HG-GIT 
Bookmark

was added a long time ago when this extension was not part of TortoiseHG | Mercurial, not sure what the configuration is today

C Create a new git repository with reading | write him access (or remember the existing one ?!)

D Add git -repo from p. C to the [paths] .hgrc section for the Mercurial repository that you want to export to Git under any name. Sample for my local Mercurial repository that has git -mirror on Github

 [paths] default = git+ssh:// git@github.com /lazybadger/Fiver-l10n.git 

E After that you can use the git repository as a regular remote repository in Mercurial, and as a fist operation (for creating an empty git repository) you must click on your new remote

F Check for the existence of a git repository with the full history from Mercurial reflected in it after clicking

G Use the git repository in the usual way

Sources Used in This Guide

  • Local Mercurial WP theme repository with a very simple linear history

Local repo in workbench

Mirror

+5
source

Source: https://habr.com/ru/post/1494490/


All Articles