github上传大文件——GIT LFS

github大文件上传

不借助LFS的情况下,push超过50M的文件github会告警,push超过100M的文件会error

简单介绍一下git lfs的使用(windows)
使用工具: git for windows
在这里插入图片描述
按如下步骤即可实现超过100M的文件上传

git lfs install
git lfs track Test.zip
git add .gitattributes
git add Test.zip
git commit -m "push big file by lfs"
git config lfs.https://github.com/Kevin1906721262/Test.git/info/lfs.locksverify false
git push origin main

在这里插入图片描述

Linux & Mac

linux

curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash

sudo apt-get install git-lfs
git lfs install

mac

安装HomeBrew /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install git-lfs
git lfs install

踩坑

1.报错:TLS certificate verification has been disabled!
解决:git config --global http.sslVerify true
2.报错:Remote “origin” does not support the LFS locking API. Consider disabling it with
:
$ git config lfs.https://github.com/Kevin1906721262/Test.git/info/lfs.locksverify false
Post “https://github.com/Kevin1906721262/Test.git/info/lfs/locks/verify”: dial t
cp 20.205.243.166:443: connectex: A connection attempt failed because the connec
ted party did not properly respond after a period of time, or established connec
tion failed because connected host has failed to respond.

解决:git config lfs.https://github.com/Kevin1906721262/Test.git/info/lfs.locksverify false
3.设置上传github的缓冲区大小为500M
git config http.postBuffer 524288000
git config -l # 查看git config

参考文章:https://www.jianshu.com/p/493b81544f80 。感谢大佬!

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值