我们在把某些文件上传到GitHub上的时候,经常会遇到文件过大不让上传的提示:Yowza, that’s a big file. Try again with a file smaller than 50MB.甚至than 25MB都不让上传。瞬间崩溃:“shit”。莫慌~其实Git早已准备好了另一工具 Git LFS,使用如下:
首先确保你的电脑安装了Git并且版本不低于1.8.5。
1、点击官网链接:Git Large File Storage
2、打开终端,并把图(2)箭头所指的 brew install git-lfs 输入到终端

3、按照图(3)所示的三步骤操作(也就是官网原文)

举个🌰:如果你想上传一个大于100MB的 .zip 文件。1、cd到你的文件目录,2、git lfs track "*.zip",3、git add .gitattributes,4、git add name.zip(name.zip是你的.zip文件名),5、git commit -m "add name zip",6、git push origin master。如图(4)

第一次上传时候还会要求输入账号、密码,按提示输入就好。
网友评论