Github上传大文件

1.访问github

这里挂了梯子还进不去(可以ping通github但无法访问网页),需要修改hosts,添加以下内容,参考:https://blog.csdn.net/suzhiwei_boke/article/details/125164328

image

2.安装GitLFS

将GitLFS安装到Git的bin文件夹下,官网链接:https://git-lfs.com/

运行exe程序时可能会出现以下报错,解决方法

image

验证安装

image

3.上传

当我们在github版本库中发现一个问题后,你在github上对它进行了在线的修改;或者你直接在github上的某个库中添加readme文件或者其他什么文件,但是没有对本地库进行同步。这个时候当你再次有commit想要从本地库提交到远程的github库中时就会出现push失败的问题。需要先pull合并到本地,在将完整内容push

github有存储限额,因此太大的文件也是不好上传的(氪金另说)

git init                                 #初始化仓库
git lfs track a.zip                      #要上传的文件
git add .gitattributes                   #先将 .gitattributes 文件提交到 git 云端上
git commit -m "文件说明"
git remote add origin https://仓库地址    #将本地的仓库关联到github上
git pull --rebase origin master          #将远程库中的更新合并到本地库中,–rebase的作用是取消掉本地库中刚刚的commit,并把他们接到更新后的版本库之中
git push -u origin master                #将文件上传到github仓库中的master分支
git add a.zip                            #通过 Git LFS 提交大文件
git push -u origin master                #上传

猜你喜欢

转载自blog.csdn.net/qq_51641196/article/details/128774450