Gigrator
Git repos migration tool which supports Github / Gitee / Gitlab / Gitea / Coding / Gogs / 腾讯工蜂.
Install / Use
/learn @k8scat/GigratorREADME
Gigrator
Gigrator 是一个 Git 代码仓批量迁移工具,支持众多流行的代码托管平台,包括 GitHub、码云(Gitee)、GitLab、Gitea、Coding、Gogs、腾讯工蜂,同时可以基于本项目进行拓展其他代码托管平台。
支持的平台
说明:
- 暂不支持迁移至
Coding,可从 Coding 迁移至其他Git服务器 - 由于
Coding的升级,其基础API不再是https://coding.net,而改为:https://{username}.coding.net - 迁移前请确认已在Git服务器上添加
SSH Key - 只能迁移指定用户下的仓库,即
{username}/{repo_name},不包括参与的或者组织的仓库 - 迁移包括commits、branches和tags,不包括issues、pr和wiki
安装
pip 安装
pip install gigrator
源码安装
git clone https://github.com/k8scat/gigrator.git
cd gigrator
make
使用
环境要求
- Git
- Python3
配置文件
参考 config.yml
运行
gigrator -c config.yml
扩展更多平台
基于 Git 类实现其他平台的代码仓迁移
class Git:
def list_repos(self) -> list:
raise NotImplementedError
def create_repo(self, name: str, desc: str, is_private: bool) -> bool:
raise NotImplementedError
def is_repo_existed(self, repo_name: str) -> bool:
raise NotImplementedError
贡献
<a href="https://github.com/k8scat/gigrator/graphs/contributors"> <img src="https://contrib.rocks/image?repo=k8scat/gigrator" /> </a>Note:
- 不支持迁移至
Coding, 可从 Coding 迁移至其他Git服务器 - 由于
Coding的升级, 其基础API不再是https://coding.net, 而改为:https://{username}.coding.net - 迁移前请确认已在Git服务器上添加
SSH Key - 只能迁移指定用户下的仓库, 即
{username}/{repo_name}, 不包括参与的或者组织的仓库 - 迁移包括commits、branches和tags, 不包括issues、pr和wiki
环境
- Git
- Python
开发环境: git version 2.20.1 (Apple Git-117) + Python 3.7.2
