git上传大文件

git 上传大文件

  • 首先下载git lfs.
  • 然后开启 LFS 功能:
# 只需执行一次即可,即可开启 lfs 功能
$ git lfs install 
// 其次,选择您希望 Git LFS 管理的文件类型,默认会生成一个 .gitattributes 文件
# 此处建议此种格式,可以统一关联 .zip 类型的文件(具体文件类型,视项目而定)
$ git lfs track "* .zip"
// 先将 .gitattributes 文件提交到 git 云端上面。
$ cd xxx
$ git add .gitattributes
$ git commit -m '提交 .gitattributes 文件'
$ git push origin master
  • 然后再次通过 Git LFS 提交大文件。
# 其中 xxx 代表大文件路径
$ git add xxx
$ git commit -m '提交 xxx 大文件'
$ git push origin master

出现的问题

  • Remote "origin" does not support the LFS
//按提示重新敲一遍就好了
$ git config 'lfs.https://github.com/AlbertLiangzt/learn.git/info/lfs.locksver ify' false
$ git config lfs.https://github.com/AlbertLiangzt/learn.git/info/lfs.locksver ify false
  • OpenSSL SSL_read: Connection was reset, errno 10054
//打开Git命令页面,执行git命令脚本:修改设置,解除ssl验证
git config --global http.sslVerify "false"
//Windows用户:cmd命令窗口执行:
ipconfig /flushdns

你可能感兴趣的:(git上传大文件)