【问题标题】:Converting bazaar repo to git on linux在 linux 上将 bazaar repo 转换为 git
【发布时间】:2016-08-13 13:10:14
【问题描述】:

如何将 bazaar repo 转换为 git?我有旧的 zip 存档,其中包含 .bzr 目录。

我尝试关注this tutorial,但是当我尝试安装时:

sudo apt-get install bzr-fastimport

错误提示没有 bzr-fastimport 包并且有 python-fastimport 我已经安装了但是

bzr fast-export --plain `pwd`

显示错误:

bzr: ERROR: unknown command "fast-export"

我也尝试按照解决方案来回答这个问题:The right way to convert from bazaar to git and sync them

我在 github 上创建了新的 repo,但是当我调用时:

bzr dpush https://github.com/jcubic/aikiframework.git,branch=master

我有错误:

bzr: ERROR: Not a branch: "https://github.com/jcubic/aikiframework.git,branch=trunk/".

【问题讨论】:

  • 本教程适用于 Ubuntu 10.04 LTS,仍然可以下载。您可以将其安装在虚拟机中进行转换。
  • 我可以确认,虽然教程是针对 10.04 的,但 sudo apt-get install bzr-fastimport 命令在 14.04 中仍然有效。

标签: git github bazaar


【解决方案1】:

获取 Bazaar 的 fastimport 插件的另一种方法(而不是按照 this answer 的建议下载 Yakkety Yak 包)是直接从 Launchpad 上的上游源获取它(感谢 this blog post by Robin Winslow):

cd ~/.bazaar/plugins
bzr branch lp:bzr-fastimport fastimport

然后您可以返回到包含您的 bzr 存储库的目录并进行转换:

git init 
bzr fast-export --plain . | git fast-import 

【讨论】:

  • 注意:还需要apt-get install python-fastimport
【解决方案2】:

16.04版本没有bzr-fastimport的包我从Yakkety Yak下载文件bzr-fastimport_0.13.0.orig.tar.gz解压复制到~/.bazaar/plugins/fastimport目录然后我可以调用:

bzr fast-export --plain `pwd` | git fast-import
git remote add origin https://github.com/jcubic/aikiframework.git
git push origin master

【讨论】:

    【解决方案3】:

    作为更新。从 18.04(仿生)开始,bzr-fastimport 又是 part of Ubuntu,而且似乎从 19.10(eoan)开始,它甚至被集成到了 bzr 包中。

    当前的转换方法是安装 bzr 和 bzr-fastimport。

    sudo apt install bzr
    sudo apt install bzr-fastimport
    

    然后在 Bazaar 存储库目录中创建一个新的 Git 存储库,在 Git 上执行快速导出/导入、签出 master(应该说“已经在 master”上),然后创建一个新的“.git”目录并如有必要,可以删除“.bzr”目录。

    cd repo-dir
    git init
    bzr fast-export | git fast-import
    git checkout -f master
    rm -rf .bzr
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-12-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-04-21
      • 1970-01-01
      相关资源
      最近更新 更多