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
相关推荐
_君莫笑6 小时前
大厂Git使用规范
git
无心水13 小时前
【Hermes:安全、权限与生产环境】39、智能体也会犯错?Hermes 纠错、回滚与遗忘机制全指南 —— 让 AI 的错误像 Git 一样可逆可控
人工智能·git·安全·mcp协议·openclaw·hermes·honcho
南境十里·墨染春水18 小时前
linux学习进展 git详解
linux·git·学习
zhangfeng113318 小时前
CodeBuddy ai对话框上面的git docs terminal Rulds 干嘛用的,以thinkphp fastadmin 为例,插件市场
人工智能·git·编程
OYangxf19 小时前
Git Conflict Resolution
大数据·git·elasticsearch
高斯林.神犇19 小时前
Git全套流程
git
次元工程师!21 小时前
LangFlow开发(一)—安装和部署
git·python·大模型·langflow
怣疯knight21 小时前
【无标题】
git
Jim-zf1 天前
git 锁文件
git
lcx_defender1 天前
Git常见操作与指令
git