【问题标题】:Converting Mercurial to Git using TortoiseHG. No files are created使用 TortoiseHG 将 Mercurial 转换为 Git。没有文件被创建
【发布时间】:2019-08-29 00:47:25
【问题描述】:

我想将 Mercurial 项目转换为 Git 项目。我正在使用 TortoiseHG 遵循https://stackoverflow.com/a/34853438/984003 此处的指示。

  1. 启用 hggit

  2. 打开命令行,输入一个空目录。

  3. git init --bare .git

  4. cd 到 Mercurial 存储库。

  5. hg 书签 hg

  6. hg push c:/path/to/your/git/repo

  7. 在Git目录下:git config --bool core.bare false

push 命令后,它说

添加了 5815 个提交,包含 24723 个树和 24178 个 blob

所以发生了一些事情。但是,当我转到 repo 目录(我推送到的路径)时,它是空的,除了 .git

【问题讨论】:

  • 您是否尝试检查某些变更集?
  • 我对 Git 完全陌生,因此从 Mercurial 转换 :) 从哪里结帐?
  • @user984003 与 mercurial 中的相同 - 您需要 git checkout 到特定修订版,使用 git log 检查它
  • @torek 他们不是在第 7 步“裸露”了吗?
  • @zerkms: 哦,我明白这里发生了什么:我们的想法是将 Git 存储库写入.git,而不是X.git——然后你可以克隆到@987654326 @ 创建X/.git——你有一些东西,当你移除裸露的部分时,应该让它的 parent 目录成为工作树。如果一切都恰到好处,那实际上可以工作。 (我没有 TortoiseHG,所以我无法测试这些确切的步骤,如图所示。)

标签: git mercurial tortoisehg


【解决方案1】:

@zerkmas 就在 cmets 中。

从 c:/path/to/your/git/repo,执行:

git checkout hg

然后所有的文件都出现了。

编辑:最后,这对我也没有用。它失去了树枝。

我最终使用了 GitHub 的导入器:

Convert Bitbucket Mercurial repository to Git. Maintain branches and history. Online solution

【讨论】:

    猜你喜欢
    • 2012-05-29
    • 1970-01-01
    • 2012-09-12
    • 2012-02-27
    • 2013-04-08
    • 2010-12-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多