git
› Pro Git
› Atlassian Git Tutorial
› Pro Git 简体中文翻译
› GitX
zhiiker
V2EX  ›  git

如何导出全部的 git repo

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

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

    8 replies  •  2019-10-10 13:50:03 +08:00
    pmispig
    pmispig
    Oct 10, 2019
    1
    我自己是用 python 调用 gitlab 的接口,获取所有 repo 的 ssh 地址,然后再 git clone --mirror
    jackleeforce3615
    jackleeforce3615
    Oct 10, 2019
    2
    哪里导哪里? gitlab?github?bitbucket?
    zhiiker
    zhiiker
    OP
    Oct 10, 2019
    3
    @jackleeforce3615 #2 github 批量导出到本地,再批量备份到 gitlab
    zhiiker
    zhiiker
    OP
    Oct 10, 2019
    4
    @pmispig #1 如何实现获取 github 的所有 repo 地址?不过这样四百多个 repo 不能保证每个都 clone 完整
    pmispig
    pmispig
    Oct 10, 2019
    5
    @zhiiker 保证 clone 完整是 git 这个工具的问题,为啥不能保证完整?
    所有 repo 地址自己用爬虫实现呗
    jackleeforce3615
    jackleeforce3615
    Oct 10, 2019❤️1
    6
    @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
    zhiiker
    OP
    Oct 10, 2019
    7
    @pmispig #5 国内复杂的网络原因,经常会出现中断,repo 数量一大就很难知道哪个出错
    Deteriorator
    Deteriorator
    Oct 10, 2019
    8
    @zhiiker 用国外的小鸡 clone,然后再打包下载
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1682 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 1225ms · UTC 23:40 · PVG 07:40 · LAX 15:40 · JFK 18:40
    ♥ Do have faith in what you're doing.