惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
C
Check Point Blog
B
Blog RSS Feed
G
Google Developers Blog
H
Help Net Security
博客园 - Franky
Blog — PlanetScale
Blog — PlanetScale
H
Hackread – Cybersecurity News, Data Breaches, AI and More
量子位
Recent Announcements
Recent Announcements
B
Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
D
DataBreaches.Net
小众软件
小众软件
T
The Blog of Author Tim Ferriss
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
MongoDB | Blog
MongoDB | Blog
Y
Y Combinator Blog
T
Tailwind CSS Blog
J
Java Code Geeks
MyScale Blog
MyScale Blog
雷峰网
雷峰网
有赞技术团队
有赞技术团队
博客园 - 聂微东

CAYZLH

Reasonix 开箱:聊聊我装的那些 Skill 收藏一份自驾中国的愿望清单 白夜行·谢幕 英雄联盟的昨日今天与符文大乱斗 折腾的尽头是极简 一个 `data.` 引发的血案——Redis 连接 localhost 问题排查全记录 MacBook上备忘录APP的快捷键和手势 让Google屏蔽某些搜索结果 WSL自定义安装Ubuntu typora自动上传图片配置 自建giscus服务 Windows下结束指定端口的进程 批量修改maven多模块版本号 使用winsw部署SpringBoot项目 Gson简易指南 docker搭建Consul集群 使用Docker部署SpringBoot项目 Docker使用redis镜像 Docker使用rabbitmq Docker使用zookeeper Docker使用MySQL Dockerfile常用指令 Docker免sudo操作 雷鸟电视去广告 使用ADB卸载MIUI系统应用 利用GitHub做图床 将网站变成灰色 Android远程调试命令adb vscode快捷键的使用 SpringBoot文件上传异常处理
Github上传大文件
Ant丶 · 2022-12-04 · via CAYZLH

GitHubpush单个超过100M文件的时候,会报一下错误:

remote: Resolving deltas: 100% (472/472), done.
remote: error: GH001: Large files detected.
You may want to try Git Large File Storage - https://git-lfs.github.com.

解决

根据提示,访问https://git-lfs.github.com,通过安装git-lfs来上传大文件。

安装

  • 直接在官网下载安装

  • Homebrew安装:

    brew install git-lfs
  • MacPorts安装:

    port install git-lfs

使用

  • 在项目根目录执行一次

    git lfs install
  • 选择希望Git LFS管理(或直接编辑.gitattributes)的文件类型。可以随时配置其他文件扩展名。

    git lfs track "*.psd"
  • .gitattributes文件加入到版本控制

    git add .gitattributes
  • 像往常一样提交并推送到GitHub。

    git add file.psd
    git commit -m "Add design file"
    git push origin master

总结

当需要用GitHub来保存一些电子书等文件的时候,就可以使用这种方式来push