【问题标题】:Cannot use hg-git or hg convert to convert a Git repository to Mercurial无法使用 hg-git 或 hg convert 将 Git 存储库转换为 Mercurial
【发布时间】:2014-02-27 21:25:39
【问题描述】:

我正在尝试将现有的 git 存储库转换为 mercurial,但没有运气。我已经尝试过 hg convert,但是当我按如下方式运行 hg convert 时:

hg convert --source-type git --dest-type hg file:///home/localalexa/GitProject/

我收到以下错误:

file:///home/localalexa/GitProject/ does not look like a Git repository

当我尝试使用 hg-git 克隆存储库时,我得到了同样的错误。我已经尝试使用 hg convert 和 hg-git 针对本地克隆的存储库和通过 HTTP 提供的存储库,并且我已经尝试了 Windows 和 Linux 机器上的转换/克隆过程。非常感谢您对此提供任何帮助。

【问题讨论】:

    标签: mercurial hg-git mercurial-convert


    【解决方案1】:

    我终于想出了一种方法让 Mercurial 将 git repo 识别为 git repo,我采取的步骤如下(假设您已经在系统上设置了 hg-git):

    1. 在您的系统上安装 git,如果存储库是远程的,请将存储库克隆到您的本地系统。

    2. 使用本地系统上的 git 守护程序为本地存储库提供服务,如下所示(在 Windows 上,您可以省略 '&',这只是告诉 Linux 异步执行命令):

      git daemon --base-path=/path/to/repository/parent/ --export-all&

    3. 使用 Mercurial 克隆存储库:

      hg 克隆 git://localhost/GitProject

    【讨论】:

    • hg-git easy 克隆远程 Git-repos
    • 我也无法克隆本地存储库,直到我通过 git 守护进程提供它。
    • 我说过 p.1 跟踪“...如果存储库是远程的,请将存储库克隆到本地系统” - 你有 远程存储库,你建议 让它在本地化,让更多人头疼
    猜你喜欢
    • 2011-03-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-11-23
    • 2019-10-02
    • 2012-10-18
    • 2010-10-23
    • 1970-01-01
    相关资源
    最近更新 更多