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 。感谢大佬!