目录
一、上传项目
献上大佬的git手把手教程:
https://blog.csdn.net/andylauren/category_6860541.html
B站快速上手视频:
https://www.bilibili.com/video/av58028472?from=search&seid=8865003535614613456
我的教程
在github官网创建一个repository后
写好相关信息。然后进入这个页面:
下载好git之后安装,
git v2.24下载地址:
进入你的工程的目录鼠标右键打开git-bash
按照上上图create a new repository的步骤来,注意这里不能照抄我的,你要用自己的github的提示的命令:
echo "# MXnet-Unet" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/UryWu/MXnet-Unet.git
git push -u origin master
然后现在你在github的项目文件夹下只会有一个readme.me,不用着急。
进入你本地的工程目录把代码写进一个文件夹,数据放进另个文件夹。比如代码放进src,数据放进data,
然后在git-bash里
git add src data
git commit -m "add src data"
git push
如果现在你出现报错:error: failed to push some refs to 'https://github.com/UryWu/MXnet-Unet.git'
照这个网址的指示:
https://blog.csdn.net/MBuger/article/details/70197532
git pull --rebase origin master
将远程更新的内容下载到本地,然后再上传本地的代码:
或者加-f 强行改写,然后继续push
git push
遇到超过100MB的单个大文件时,会报错。
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.
我的做法是先把大文件弄出来,先push能push的,再下载一个git-lfs
https://git-lfs.github.com/
安装好后在你的工程目录打开一个git-bash,输入:
git lfs install
然后追踪大文件,并添加:
git lfs track "output/*.params"
git add .gitattributes
git add ./output/*.params
git commit -m "commit large file"
git push origin master
成功:
二、通过pycharm更新项目
三、通过gitbash更新项目
# 添加本地的某个新文件到本地仓库,但是,此时只是提交到了本地仓库,并没有提交到远程仓库。
git add XXX
# 增加所有更新的代码
git add .
# 提交代码到本地仓库,并没有到远程仓库,不理解的可以去了解一下git的原理。
git commit -m 'message'
# 这个命令将上面两个步骤 add 和 commit 合二为一。
git commit -am 'message'
# 将更改从本地仓库提交到远程仓库
git push
1、进入你的repository点击setting
2、翻到最下面点击Delete this repository
3、再次输入你要删除的这个repository,然后点击删除这个仓库。
四、其它参考:
1.git命令思维导图:
2.Github超过100M的大文件上传
https://www.jianshu.com/p/7d8003ba2324
3.如何在GitHub上传自己的项目
https://zhuanlan.zhihu.com/p/61397894
Debug:
ERROR1:Git 克隆错误‘RPC failed; curl 56 Recv failure....‘
https://blog.csdn.net/qq_34121797/article/details/79561110
git config --global http.postBuffer 524288000
把这个524288000增大,这个的单位应该是字节,我上传的工程有1.3G,我改为了1 500 000 000