cd upload #进入名为upload的文件夹,提前将要上传的大文件放入该文件夹下
git init #创建本地仓库环境
git lfs install #安装大文件上传应用
git lfs track * #追踪要上传的大文件,*表示路径下的所有文件
git add .gitattributes #添加先上传的属性文件(要先上传属性文件,不然有可能失败)
git commit -m "pre" #添加属性文件上传的说明
git remote add origin https://github.com/Youpeng-Zhang/MOP.git #建立本地和Github仓库的链接
git push origin master #上传属性文件
git add * #添加要上传的大文件,*表示路径下的所有文件
git commit -m "Git LFS commit" #添加大文件上传的说明
git push origin master #上传大文件
出现以下error的解决方案:
unable to access 'https://github.com/MTXLD/PDF.git/': Recv failure: Connection was reset
1.git config --global --unset http.proxy
2.git config --global --unset https.proxy
3.cmd:ipconfig/flushdns
4.git remote set-url origin https://github.com/MTXLD/PDF.git
5.git push origin master