【Gitee 大文件上传问题】

428 阅读1分钟

::: tip 注意 大文件提交要在项目初始化之前处理

安装 lfs

 cd xxx 

 git lfs install


设置LFS要管理的文件类型


 git lfs track "*.gz"


执行完上面的命令后,会生成一个.gitattributes文件,要将其上传到远程gitee仓库。这里我把.gitattributes和大文件分开上传

 git add .gitattributes
 git commit -m '提交 .gitattributes 文件'
 git push origin master(如果提交不了,后面可以加一个-f)


上传大文件

 git add ./bigData 
 git commit -m "upload Models"
 git push origin master -f


报LFS错

第一种报错

batch response: LFS only supported repository in paid or trial enterprise.

rm .git/hooks/pre-push git push -u origin "master"


##### 第二种报错

WARNING: Authentication error: Authentication required: LFS only supported repository in paid enterprise.

git config lfs.https://gitee.com/{your_gitee}/{your_repo}.git/info/lfs.locksverify false


```

注: 命令中的{your\_gitee}/{your\_repo}是你的远程仓库地址,根据自己情况替换。

> 本文使用 [文章同步助手](https://juejin.cn/post/6940875049587097631) 同步