Leif160519的blog Leif160519的blog

——————

目录
Github如何上传超过100M的大文件
/    

Github如何上传超过100M的大文件


GitHub不允许直接上传大文件(超过100M)的文件到远程仓库,若要想继续提交可以尝试使用大文件支持库:https://git-lfs.github.com
LFS使用的简单步骤:

1.安装git - lfs到本机

image.png

我使用的mac,这里有三种安装方式,按自己的习惯来,我用的是Homebrew方式安装。

1.安装Git命令行扩展。只需要设置一次Git LFS。

在项目目录下,执行以下命令:

git lfs install

2.选择您希望Git LFS管理的文件类型(或直接编辑.gitattributes)。您可以随时配置其他文件扩展名。这一步成功后会生成一个gitattributes文件

git lfs track <your_commit_big_file_name> 

3.添加并commit gitattributes文件

git add .gitattributes

4.然后再添加大文件到本地缓存区

git add <your_commit_big_file_name>
git commit -m "提交大文件"
git push 

“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” – Tom Cargill

标  题Github如何上传超过100M的大文件
作  者Leif160519
出  处https://github.icu/articles/2020/04/02/1585817747084.html
关于博主:坐标南京,运维工程师,如有问题探讨可以直接下方留言。
声援博主:如果您觉得文章对您有帮助,可以评论、订阅、收藏。您的鼓励是博主的最大动力!