Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在OSX上将hg回购转换为git回购_Git_Mercurial - Fatal编程技术网

如何在OSX上将hg回购转换为git回购

如何在OSX上将hg回购转换为git回购,git,mercurial,Git,Mercurial,是的,我知道hg-fast-export.sh 即使我最终设法让它找到mercurial模块,它在我的回购协议上仍然不起作用: $ $HOME/Notes/fast-export/hg-fast-export.sh -r $HOME/path-to-repo Error: repository has at least one unnamed head: hg r194 git-fast-import statistics: . . . 在目标git回购协议中不产生任何内容 我曾尝试在git

是的,我知道hg-fast-export.sh

即使我最终设法让它找到mercurial模块,它在我的回购协议上仍然不起作用:

$ $HOME/Notes/fast-export/hg-fast-export.sh -r $HOME/path-to-repo
Error: repository has at least one unnamed head: hg r194
git-fast-import statistics:
. . .
在目标git回购协议中不产生任何内容

我曾尝试在git回购协议中使用hg-to-git:

$HOME/Desktop/tmp/git-master/contrib/hg-to-git/hg-to-git.py -v .
tip is 1197
analysing the branches...
Traceback (most recent call last):
  File "/Users/dsw/Desktop/tmp/git-master/contrib/hg-to-git/hg-to-git.py", line 135, in <module>
    hgchildren[parent] += ( str(cset), )
KeyError: '-1'
$HOME/Desktop/tmp/git-master/contrib/hg-to-git/hg-to-git.py-v。
小费是1197
分析分支。。。
回溯(最近一次呼叫最后一次):
文件“/Users/dsw/Desktop/tmp/git-master/contrib/hg-to-git/hg-to-git.py”,第135行,在
hgchildren[parent]+=(str(cset),)
KeyError:“-1”
也许这是hg-to-git试图告诉我和hg fast export告诉我的一样的事情,只是以一种更为发自内心和完形的方式。不知何故,我认为一个工具应该在一个奇怪的情况下继续运行,并至少产生部分结果,即使它通知用户问题


有人有什么建议吗?

我从来都不想这样做,但我相信最简单的方法是:

  • 安装
  • 在某处创建一个空的git回购
  • 回到hg回购协议
  • 创建一个名为master的书签,指向你的头部
  • hg推送(吉特回购)
  • 基本上,阅读这一页。都在那里。

    这个问题有答案。