gitup

Github上传代码菜鸟超详细教程【转】

最近需要将课设代码上传到Github上,之前只是用来fork别人的代码。

这篇文章写得是windows下的使用方法。

第一步:创建Github新账户

第二步:新建仓库

第三部:填写名称,简介(可选),勾选Initialize this repository with a README选项,这是自动创建REAMDE.md文件,省的你再创建

第四步:安装Github shell程序,

第五步:打开Git Shell,输入以下命令生成密钥来验证身份

ssh-keygen -C 'your@email.address' -t rsa

cat ~/.ssh/id_rsa.pub

把文件夹下的id_rsa.pub文件内容全部复制。

然后打开github账户设置,如图

打开ssh keys

https://github.com/settings/ssh。

第六步:在Git Shell下输入命令测试刚才的公钥是否认证正确。

ssh -T git@github.com

正确结果会显示:



第七步:clone刚才新建的repository 到本地,输入命令:

https://github.com/paohaijiao/storm.git

git config --global http.sslVerify false

[root@localhost code]# git clone https://github.com/paohaijiao/storm.git

这时会在目录下生成:描述性文件

第八步:将想上传的代码目录拷贝到此文件夹下:

第九步:切换到Git shell 命令行下,输入命令:

[root@localhost storm]# git add README.md
[root@localhost storm]# git commit -m "first commit"
[master 9bacb7b] first commit
 1 file changed, 1 insertion(+)
 create mode 100644 README.md
[root@localhost storm]# git remote add origin https://github.com/paohaijiao/storm.git
fatal: remote origin already exists.
[root@localhost storm]# git remote rm origin
[root@localhost storm]# git remote add origin https://github.com/paohaijiao/storm.git
[root@localhost storm]# git push -u origin master





转载于:https://my.oschina.net/goudingcheng/blog/614294

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值