Migrating from Mercurial to Git

社会主义新天地 提交于 2019-12-05 17:30:44
  1. Add hg-git to Mercurial
  2. Push hg-repo to git-target

Step-by-step Guide

A Clone Hg-Git Extension from it's repository into some local PATH\TO\HG-GIT

B Enable extension in (global mercurial.ini or repository's-specific .hgrc)

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

bookmark was added long time ago, when this extension wasn't part of TortoiseHG|Mercurial, not sure about today's configuration

C Create new Git-repository with read|write access to it (or remeber existing?!)

D Add Git-repo from p. C into [paths] section of .hgrc for Mercurial repository, which you want to export in Git under any name. Sample for my local Mercurial repository, which have Git-mirror on Github

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

E After it you can use Git-repository as usual remote repository in Mercurial and, as fist operation (for created empty Git-repository) you have to push to your new remote

F Check existence of Git-repository with full history from Mercurial mirrored into it after push

G Use Git-repository by usual way

Sources, used in this guide

  • Local Mercurial repository of WP-theme with very easy linear history

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!