github-上传项目、通过pycharm更新项目、删除代码仓库

目录

一、上传项目

献上大佬的git手把手教程:

B站快速上手视频:

我的教程

 

二、通过pycharm更新项目

 

三、其它参考:

Debug:


一、上传项目

献上大佬的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下载地址:

https://fb187cdbcc69278c9f1e6ce8e7257596.dd.cdntips.com/dl.softmgr.qq.com/original/Development/Git-2.24.1.2-64-bit.exe?mkey=5e1d52a575b64572&f=1455&cip=117.182.99.135&proto=https

进入你的工程的目录鼠标右键打开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

 四、github里如何删除一个repository仓库

1、进入你的repository点击setting

2、翻到最下面点击Delete this repository

3、再次输入你要删除的这个repository,然后点击删除这个仓库。

四、其它参考:

1.git命令思维导图:

https://upload-images.jianshu.io/upload_images/290760-e8491f69473bf200.jpg?imageMogr2/auto-orient/strip|imageView2/2/w/1200/format/webp

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值