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
相关推荐
GISer_Jing2 小时前
Git协作开发:feature分支、拉取最新并合并
大数据·git·elasticsearch
高山莫衣8 小时前
git rebase多次触发冲突
大数据·git·elasticsearch
码农藏经阁8 小时前
工作中常用的Git操作命令(一)
git
kobe_OKOK_8 小时前
【团队开发】git 操作流程
git·elasticsearch·团队开发
码农垦荒笔记8 小时前
Git 安装闭坑指南(仅 Windows 环境)
windows·git
CC码码18 小时前
管理你的多个 Git 密钥(多平台多账号)
git·gitlab·github
CC码码18 小时前
管理你的多个 Git 密钥(单平台多账号)
git·gitlab·github
大卫小东(Sheldon)18 小时前
GIM 1.5发布了! 支持Windows系统了
git·ai·rust
flying jiang18 小时前
将大仓库拆分为多个小仓库
git
李boyang10 天前
Git(四):远程操作
git