V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
git
Pro Git
Atlassian Git Tutorial
Pro Git 简体中文翻译
GitX
zhiiker
V2EX  ›  git

如何导出全部的 git repo

  •  
  •   zhiiker · Oct 9, 2019 · 4197 views
    This topic created in 2400 days ago, the information mentioned may be changed or developed.

    官方导出数据的功能有点问题,repo 上百个就会失败,试了好几次。 需要导出所有的 bare repositories

    8 replies    2019-10-10 13:50:03 +08:00
    pmispig
        1
    pmispig  
       Oct 10, 2019
    我自己是用 python 调用 gitlab 的接口,获取所有 repo 的 ssh 地址,然后再 git clone --mirror
    jackleeforce3615
        2
    jackleeforce3615  
       Oct 10, 2019
    哪里导哪里? gitlab?github?bitbucket?
    zhiiker
        3
    zhiiker  
    OP
       Oct 10, 2019
    @jackleeforce3615 #2 github 批量导出到本地,再批量备份到 gitlab
    zhiiker
        4
    zhiiker  
    OP
       Oct 10, 2019
    @pmispig #1 如何实现获取 github 的所有 repo 地址?不过这样四百多个 repo 不能保证每个都 clone 完整
    pmispig
        5
    pmispig  
       Oct 10, 2019
    @zhiiker 保证 clone 完整是 git 这个工具的问题,为啥不能保证完整?
    所有 repo 地址自己用爬虫实现呗
    jackleeforce3615
        6
    jackleeforce3615  
       Oct 10, 2019   ❤️ 1
    @zhiiker

    在本地操作吧,写个脚本把 github 上的仓库用 git clone --bare 命令批量弄下来,具体命令参考:[git-clone]( https://git-scm.com/docs/git-clone),然后把 clone 下来的所有文件夹拷贝到 gitlab 服务器上,再通过 [Import bare repositories into your GitLab instance]( https://docs.gitlab.com/ee/raketasks/import.html)方式导入到 gitlab 仓库。
    zhiiker
        7
    zhiiker  
    OP
       Oct 10, 2019
    @pmispig #5 国内复杂的网络原因,经常会出现中断,repo 数量一大就很难知道哪个出错
    Deteriorator
        8
    Deteriorator  
       Oct 10, 2019
    @zhiiker 用国外的小鸡 clone,然后再打包下载
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5710 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 58ms · UTC 07:41 · PVG 15:41 · LAX 00:41 · JFK 03:41
    ♥ Do have faith in what you're doing.