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
相关文章
|
4天前
|
网络安全 开发工具 git
解决 Git 访问 GitHub 时的 SSL 错误
通过上述步骤,可以有效解决 Git 访问 GitHub 时的 SSL 错误。推荐优先更新 CA 证书和正确配置 Git 使用 CA 证书,避免禁用 SSL 验证。如果问题持续,可以切换到 SSH 方式访问 GitHub,确保连接的安全性和稳定性。希望这些内容对您的学习和工作有所帮助。
49 3
|
8天前
|
开发工具 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 报错如何解决-优雅草卓伊凡
25 3
git 使用之remote: File [4e21e71a555febaa4dfaaa05cf7eeb606ea96ae2] size 104.090MB, exceeds quota 100MB remote: Please remove the file[s] from history and try again 报错如何解决-优雅草卓伊凡
|
1月前
|
开发工具 git
如何操作github,gitee,gitcode三个git平台建立镜像仓库机制,这样便于维护项目只需要维护一个平台仓库地址的即可-优雅草央千澈
如何操作github,gitee,gitcode三个git平台建立镜像仓库机制,这样便于维护项目只需要维护一个平台仓库地址的即可-优雅草央千澈
186 69
如何操作github,gitee,gitcode三个git平台建立镜像仓库机制,这样便于维护项目只需要维护一个平台仓库地址的即可-优雅草央千澈
|
1月前
|
Devops Shell 网络安全
git使用之如何将一套代码同时推送至github|gitee|gitcode|gitlab等多个仓库-含添加ssh-优雅草央千澈完美解决-提供整体提交代码
git使用之如何将一套代码同时推送至github|gitee|gitcode|gitlab等多个仓库-含添加ssh-优雅草央千澈完美解决-提供整体提交代码
85 16
git使用之如何将一套代码同时推送至github|gitee|gitcode|gitlab等多个仓库-含添加ssh-优雅草央千澈完美解决-提供整体提交代码
|
3月前
|
Linux 网络安全 开发工具
IDEA如何配置git和github
【11月更文挑战第14天】本指南详细介绍了如何在 IntelliJ IDEA 中配置 Git 和 GitHub,包括检查和设置 Git 路径、测试配置,以及通过 SSH 或 HTTPS 方式配置 GitHub 仓库的具体步骤。完成配置后,用户可在 IDEA 中轻松进行版本控制操作。
473 0
|
3月前
|
网络安全 开发工具 git
解决fatal:remote error:You can’t push to git://github.com/username/*.g
通过上述诊断与修复步骤,绝大多数的推送错误都能得到有效解决,确保您的Git工作流顺畅无阻。
299 1
|
开发工具 git 开发者
Git与Github两者的区别|学习笔记
快速学习Git与Github两者的区别
108 0
|
开发工具 git
Git与GitHub学习笔记(一)如何删除github里面的文件夹?
按照以下步骤即可(本地删除) 1. git pull you git url2. git checkout 3. rm -r dirName4. git add --all5. git commit -m"remove dir"6.
1030 0
|
开发工具 git
Git与GitHub学习笔记(二)提交的一些笔记
1、合并分支的使用一定要切换到master分支上去合并:git merge company2、切换分支的时候一定要提交干净本地分支的代码,才可以切换分支,否则提示错误信息: 3、这时候我们做的就是提交干净本地的代码,再次切换即可以 4、下来我们要合并一个远程的分支home分支到master主分支...
1173 0
|
开发工具 git
Git与GitHub学习笔记(四)合并远程分支
在这里的前提: 1、你已经fork 源作者的项目到你自己的仓库了 2、git clone 自己仓库fork的项目,注意地址,这里是自己的账号下的地址,而不是源作者的项目地址哦 3、在本地修改代码,git push origin master 提交到自己的主分支(自定义别的分支),  提交一个新的...
1066 0