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
相关推荐
XiaoHu02071 小时前
Linux网络编程套接字
linux·服务器·网络·git
AlexDeng1 小时前
Git 实战:我用 git worktree 一次性拉取多个工作目录
git
import_random2 小时前
[git版本控制]git pull origin main
git
ShallowLin2 小时前
Git 的分支管理
git
chen_2275 小时前
搭建git工作流
git
Rabbit_QL9 小时前
【git reset】个人分支一次精准撤回 git push 的实战记录
git
掘金忠实用户程序员9 小时前
Git多仓库协作场景
git
少年攻城狮9 小时前
Git系列---【git拉代码时报getaddrinfo() thread failed to start】
git
cicada1510 小时前
分享一个git日常开发流程
大数据·git·elasticsearch
布只道10 小时前
关于Git的一些小秘密
git