git【报错】this exceeds GitHub‘s file size limit of 100.00 MB

简介: git【报错】this exceeds GitHub‘s file size limit of 100.00 MB
$ git push orgin master
Enumerating objects: 7, done.
Counting objects: 100% (7/7), done.
Delta compression using up to 4 threads
Compressing objects: 100% (6/6), done.
Writing objects: 100% (7/7), 313.63 MiB | 838.00 KiB/s, done.
Total 7 (delta 0), reused 0 (delta 0)
remote: warning: File docker/Docker容器与容器云(第2版).pdf is 51.35 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File docker/Docker实战.pdf is 97.64 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: error: Trace: 1cfbf943c54b3452f96941481112e6535eb9db73b88495250362999ad6fbf534
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File docker/《互联网企业容器技术实践》_龚曦_2019-01-01.pdf is 197.29 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
To https://github.com/Ghostwritten/pdfbook.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/Ghostwritten/pdfbook.git'

解决方法

https://git-lfs.github.com/

1.下载并安装 Git 命令行扩展。下载并安装后,运行以下命令为您的用户帐户设置 Git LFS:

git lfs install

2.在您要使用 Git LFS 的每个 Git 存储库中,选择您希望 Git LFS 管理的文件类型(或直接编辑您的 .gitattributes)。您可以随时配置其他文件扩展名

git lfs migrate import --include="*.pdf"
git lfs track "*.pdf"

现在确保 .gitattributes 被跟踪:

git add .gitattributes

请注意,定义 Git LFS 应该跟踪的文件类型本身不会将任何预先存在的文件转换为 Git LFS,例如其他分支上的文件或您之前的提交历史记录中的文件。为此,请使用git lfs migrate[1]命令,该命令具有一系列选项,旨在适应各种潜在用例。

3.没有第三步。只需像往常一样提交并推送到 GitHub;例如,如果您当前的分支名为main:

git add --all
git commit -m "Add design file"
git push origin master --force
相关文章
|
1月前
|
开发工具 git
如何操作github,gitee,gitcode三个git平台建立镜像仓库机制,这样便于维护项目只需要维护一个平台仓库地址的即可-优雅草央千澈
如何操作github,gitee,gitcode三个git平台建立镜像仓库机制,这样便于维护项目只需要维护一个平台仓库地址的即可-优雅草央千澈
197 69
如何操作github,gitee,gitcode三个git平台建立镜像仓库机制,这样便于维护项目只需要维护一个平台仓库地址的即可-优雅草央千澈
|
17天前
|
开发工具 git
git 使用之remote: File [4e21e71a555febaa4dfaaa05cf7eeb606ea96ae2] size 104.090MB, exceeds quota 100MB remote: Please remove the file[s] from history and try again 报错如何解决-优雅草卓伊凡
git 使用之remote: File [4e21e71a555febaa4dfaaa05cf7eeb606ea96ae2] size 104.090MB, exceeds quota 100MB remote: Please remove the file[s] from history and try again 报错如何解决-优雅草卓伊凡
48 3
git 使用之remote: File [4e21e71a555febaa4dfaaa05cf7eeb606ea96ae2] size 104.090MB, exceeds quota 100MB remote: Please remove the file[s] from history and try again 报错如何解决-优雅草卓伊凡
|
14天前
|
网络安全 开发工具 git
解决 Git 访问 GitHub 时的 SSL 错误
通过上述步骤,可以有效解决 Git 访问 GitHub 时的 SSL 错误。推荐优先更新 CA 证书和正确配置 Git 使用 CA 证书,避免禁用 SSL 验证。如果问题持续,可以切换到 SSH 方式访问 GitHub,确保连接的安全性和稳定性。希望这些内容对您的学习和工作有所帮助。
65 3
|
1月前
|
Devops Shell 网络安全
git使用之如何将一套代码同时推送至github|gitee|gitcode|gitlab等多个仓库-含添加ssh-优雅草央千澈完美解决-提供整体提交代码
git使用之如何将一套代码同时推送至github|gitee|gitcode|gitlab等多个仓库-含添加ssh-优雅草央千澈完美解决-提供整体提交代码
94 16
git使用之如何将一套代码同时推送至github|gitee|gitcode|gitlab等多个仓库-含添加ssh-优雅草央千澈完美解决-提供整体提交代码
|
3月前
|
网络安全 开发工具 git
解决fatal:remote error:You can’t push to git://github.com/username/*.g
通过上述诊断与修复步骤,绝大多数的推送错误都能得到有效解决,确保您的Git工作流顺畅无阻。
313 1
|
3月前
|
Linux 网络安全 开发工具
IDEA如何配置git和github
【11月更文挑战第14天】本指南详细介绍了如何在 IntelliJ IDEA 中配置 Git 和 GitHub,包括检查和设置 Git 路径、测试配置,以及通过 SSH 或 HTTPS 方式配置 GitHub 仓库的具体步骤。完成配置后,用户可在 IDEA 中轻松进行版本控制操作。
531 0
|
3月前
|
开发工具 git
git 常用命令
这些只是 Git 命令的一部分,Git 还有许多其他命令和选项,可根据具体需求进行深入学习和使用。熟练掌握这些命令能够帮助你更高效地管理代码版本和协作开发。
|
1月前
|
网络安全 开发工具 git
mac git clone命令提示git@gitee.com: Permission denied (publickey).问题修复
mac git clone命令拉取gitee上项目代码时提示密钥问题
|
1月前
|
Java 网络安全 开发工具
Git进阶笔记系列(01)Git核心架构原理 | 常用命令实战集合
通过本文,读者可以深入了解Git的核心概念和实际操作技巧,提升版本管理能力。
|
2月前
|
机器学习/深度学习 Shell 网络安全
【Git】Git 命令参考手册
Git 命令参考手册的扩展部分,包含了从基础操作到高级功能的全面讲解。
85 3

热门文章

最新文章