【问题标题】:Gitlab repositry mirror to GithubGitlab 存储库镜像到 Github
【发布时间】:2020-09-14 03:59:09
【问题描述】:
  • 我想创建从 Gitlab 到 Github 的镜像仓库,但是我遇到了一个错误:Larger file than Github allow, GH001: Larger files detected,我尝试使用 git filter-branch 在所有提交中删除较大的文件,重写提交历史,成功但之后,我得到错误(在图像中)
  • 任何想法或关键字,请给我。谢谢!

【问题讨论】:

    标签: git github gitlab


    【解决方案1】:

    首先,您可以使用new git filter-repo,其中will replace the old git filter-branch or BFG
    剥离大/大文件很容易

     git filter-repo --strip-blobs-bigger-than 10M
    

    其次,git filter-branch/git filter-repo 是本地操作:您仍然需要强制推送(git push --force --mirror)到 GitLab,以便您的镜像操作反映新的存储库状态(一个没有大文件)

    【讨论】:

    • 感谢回复,我运行git filter-branch 并将 --force 成功推送到Gitlab,上图是我推送成功后错误git filter-branch
    • @Hydraw 有没有可能你只清理/推送了master,而其他分支中存在其他大文件?
    • 我检查了,所有分支都不存在大文件
    • @Hydraw 你在推送到 gitlab.com 吗?你做了git push --force --mirror,为了推送所有个分支吗?
    • 目前,因为错误所以我的镜像(Github)尚未创建(空)所以我认为我不需要运行上面的 git 命令,对吧?
    猜你喜欢
    • 1970-01-01
    • 2015-07-27
    • 1970-01-01
    • 2022-06-24
    • 1970-01-01
    • 2013-03-30
    • 2020-07-21
    • 2019-02-24
    • 2021-04-23
    相关资源
    最近更新 更多