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
相关推荐
白帽小野5 小时前
SVN和Git两种版本管理系统对比
git·svn·版本控制系统
rivercoder5 小时前
Gitea:轻量级的自托管Git服务
git·gitlab·gitea
呜喵王阿尔萨斯12 小时前
git命令解析
c++·git
Doris_LMS2 天前
Git的强软硬回退(三)
运维·服务器·数据库·git·idea
瓜酷月..2 天前
GIT(了解)
git
misty youth2 天前
git命令常用指南
git·github
持续迷茫2 天前
lint-staged 中 --verbose 选项的深度解析
前端·git
lostElk2 天前
团队 Git 分管理全流程规范
git·github
亦是行人!2 天前
删除git中已经提交的target、logs、.idea文件
git
匆叔2 天前
Git下载全攻略
前端·git