git lfs 上传超大文件

这里写自定义目录标题

1.安装lfs

bash 复制代码
 cd xxx #'xxx'是你本地仓库目录
 # 只需执行一次即可开启lfs功能
 git lfs install

2.设置LFS要管理的文件类型

bash 复制代码
 #因为我是pth模型文件过大,所以我的命令是*.pth,此处需要根据自己情况设定类型
 git lfs track "*.gz"

3.执行完上面的命令后,会生成一个.gitattributes文件,要将其上传到远程gitee仓库。这里我把.gitattributes和大文件分开上传

bash 复制代码
 git add .gitattributes
 git commit -m '提交 .gitattributes 文件'
 git push -u origin master(如果提交不了,后面可以加一个-f)

4.上传大文件

bash 复制代码
 git add ./bigData #我的大文件全在bigData文件夹下,根据自己情况更改
 git commit -m "upload Models"
 git push origin master -f

报LFS错

第一种
bash 复制代码
 # 错误
 batch response: LFS only supported repository in paid or trial enterprise.

解决方法:

bash 复制代码
 rm .git/hooks/pre-push
 git push -u origin "master"
第二种
bash 复制代码
 # 错误
 WARNING: Authentication error: Authentication required: LFS only supported repository in paid enterprise.

解决方法:

bash 复制代码
git config lfs.https://gitee.com/{your_gitee}/{your_repo}.git/info/lfs.locksverify false
相关推荐
恋喵大鲤鱼11 小时前
git mv
git·git mv
Patrick_Wilson14 小时前
Git Worktree 原理详解:从 objects / refs 看懂多分支并行与多 Agent 协作
git·面试·ai编程
yaoxiaoganggang14 小时前
克隆 Superpowers 的规则库到你的本地(或者直接作为 Git Submodule)
人工智能·经验分享·git·ai编程
Python私教17 小时前
用 Claude Code 做大型重构不翻车:分批+Git 兜底+验证闭环的实战流程(2026)
git·重构·ai编程·代码重构·工程实践·claude code
Shawn Dev18 小时前
团队协作中的 Git Tag 最佳实践:从入门到精通
大数据·git·elasticsearch
独隅19 小时前
Git/GitHub/GitLab/Gitee 核心对比指南
git·gitlab·github
佛山个人技术开发20 小时前
GitCode个人技术开发者总结完整使用指南
windows·git·svn·github·gitcode
江华森20 小时前
基于 Git 的自动集成交付(Git-Driven CI/CD)实战
git·ci/cd
Dontla1 天前
.gitkeep文件作用(让Git追踪空目录,使该目录能被纳入版本控制)!.gitkeep
大数据·git·elasticsearch
shandianchengzi1 天前
【记录】VSCode|Windows 下 VS Code 配置 Git Bash 为默认终端完整教程
windows·git·vscode·bash