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
相关推荐
Komorebi_999912 小时前
Git常用指令
git·web
一小池勺14 小时前
🚀 Git 如何让文件存在于远程仓库却不被本地追踪?
git·github
五月高高17 小时前
Idea使用git不提示账号密码登录,而是输入token问题解决
git
魏 无羡17 小时前
idea实现git版本回退的常见场景
java·git·intellij-idea
ergevv20 小时前
不同场景下git指令的搭配
git·源代码管理·代码
不了_谢谢21 小时前
项目仓库文件太大怎么清理?如何清理git仓库大文件记录?
git
nc_kai1 天前
Android Git操作
git
GUET_一路向前1 天前
【git】在Linux系统下clone指定分支
linux·运维·git
Arthurmoo2 天前
Linux系统集群部署模块之Keepalived双机热备
linux·git·github