🌞

git 提交100M以上的文件,附github基本操作流程

操作流程

1
2
3
4
remote: Resolving deltas: 100% (472/472), done.
remote: error: GH001: Large files detected.
You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: File XXX/XXX/XXX is 234 MB; this exceeds GitHub‘s file size limit of 100.00 MB 

决方法:

1、安装git -lfs到本机, https://git-lfs.github.com

2、执行:git lfs install

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

git lfs track “* .a” 注释:–这里的 “ *.a “就是你要上传的大文件的路径,可以是.xx文件

4、把 .gitattributes 文件添加到本地仓库里

git commit -m “你要添加的备注信息”

注释: 如果往下面操作可能要重新再来一遍,所以先备份一个,以后有问题可以恢复到此处

5、

1
2
3
4
5
git add .   

git commit -m "提交大文件"

git push origin master

如果上传不上去,那么执行

1
git config lfs.git@github.com:Kurby96/kurby.top.mark.git false

附件:git的常用操作流程

1、设置git用户名

1
2
$ git config --global user.name "humingx"    
$ git config --global user.email "humingx@yeah.net"

2、生成密钥,添加到github的ssh上

1
$ ssh-keygen -t rsa -C "youremail@youremail"

3、测试密钥

$ ssh -T git@github.com

你将会看到:

1
2
3
The authenticity of host 'github.com (207.97.227.239)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)?

选择 yes

1
Hi humingx! You've successfully authenticated, but GitHub does not provide shell access.

如果看到Hi后面是你的用户名,就说明成功了

4、git add . 和git commit -m “添加上备注信息”

5、git remote add origin “你仓库的github的链接”

6、git push origin master


参考文档:

https://www.jianshu.com/p/7d8003ba2324

https://blog.csdn.net/logan_lg/article/details/81502260

https://blog.csdn.net/wangwangwanglichao/article/details/79983262

https://blog.csdn.net/zhu1500527791/article/details/53119579

https://segmentfault.com/a/1190000002645623/

加载评论