在linux上将bazaar回购转换为git

在linux上将bazaar回购转换为git,git,github,bazaar,Git,Github,Bazaar,如何将集市回购转换为git?我有一个旧的zip档案,里面有.bzr目录 我已尝试遵循以下步骤,但在尝试安装时: sudo apt-get install bzr-fastimport 它得到的错误是没有bzr fastimport包,还有python fastimport,我已经安装了它,但是 bzr fast-export --plain `pwd` 显示错误: bzr: ERROR: unknown command "fast-export" 在回答这个问题时,我也试着遵循解决方案:

如何将集市回购转换为git?我有一个旧的zip档案,里面有.bzr目录

我已尝试遵循以下步骤,但在尝试安装时:

sudo apt-get install bzr-fastimport
它得到的错误是没有bzr fastimport包,还有python fastimport,我已经安装了它,但是

bzr fast-export --plain `pwd`
显示错误:

bzr: ERROR: unknown command "fast-export"
在回答这个问题时,我也试着遵循解决方案:

我在github上创建了新的回购协议,但当我打电话时:

bzr dpush https://github.com/jcubic/aikiframework.git,branch=master
我有个错误:

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

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

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

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

然后,您可以返回包含bzr repo的目录并进行转换:

git init 
bzr fast-export --plain . | git fast-import 
作为更新。自18.04(仿生版)以来,
bzr fastimport
再次出现,而且似乎自19.10(eoan)以来,它甚至集成到了包bzr中

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

sudo apt install bzr
sudo apt install bzr-fastimport
然后在Bazaar repository目录中创建一个新的Git存储库,执行快速导出/导入,在Git上签出master(应该说“已经在master上”),然后创建一个新的“.Git”目录,必要时可以删除“.bzr”目录

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

本教程是针对Ubuntu10.04LTS的,现在仍然可以下载。您可以在虚拟机中安装它来进行转换。我可以确认,尽管本教程适用于10.04,但是
sudo-apt-get-install-bzr-fastimport
命令在14.04中仍然有效。注意:您还需要
apt-get-install-python-fastimport
cd repo-dir
git init
bzr fast-export | git fast-import
git checkout -f master
rm -rf .bzr