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
相关推荐
Codeking__5 小时前
Redis——基本通用命令
redis·git·github
Dontla9 小时前
Git error: fatal: detected dubious ownership in repository at xxx
git
论迹10 小时前
【Git】-- 多人协作
git·ubuntu
roamingcode11 小时前
从混沌到秩序:Git Diff 结构化报告的 Claude Code Skill 实践
人工智能·git·agent·skill·claude code·领域知识包·ai经验复用
ss27313 小时前
idea中git更新项目:将传入更改合并到当前分支,在传入更改上变基当前分支
java·git·intellij-idea
hopsky13 小时前
好用!Git 同时开发多个分支
git
secondyoung15 小时前
Git使用:rebase用法
c语言·经验分享·git·vscode
萧曵 丶16 小时前
CI/CD 流程
git·ci/cd
import_random16 小时前
[git版本控制]git push(详解)
git
bing_feilong18 小时前
gitee pull 总是需要用户名和密码,该如何设置?
git·gitee