如何将webstrom本地的代码上传到github上

在git push时一直报错403(被拒绝),but why?又没有解释,后面在网上找了许多解决方案,自己终于解决了。我将详细流程记录下。

1、首先确保你有一个github账户,本地的git也安装好。

2、windows系统,在任意文件夹下“单击鼠标右键”可打开如下,选择git bash

如何将webstrom本地的代码上传到github上

输入ssh-****** -t rsa -C “邮箱”,输入完之后需要按三次回车,才能出现c:\users(用户)\xxx(用户名) \.ssh的文件

如何将webstrom本地的代码上传到github上

根据该指引,找到id_rsa.pub文件

如何将webstrom本地的代码上传到github上

打开,然后复制其文件下的全部内容。

3、在github上面,点击setting

如何将webstrom本地的代码上传到github上

如下操作

如何将webstrom本地的代码上传到github上

然后 title:可随意取名字,key:粘贴刚刚复制的内容

如何将webstrom本地的代码上传到github上

结果

如何将webstrom本地的代码上传到github上


4、然后在github上面新增一个仓库如“testUpload”

如何将webstrom本地的代码上传到github上

5、选择ssh,复制该路径

如何将webstrom本地的代码上传到github上

6、打开webstrom,按照如图操作

如何将webstrom本地的代码上传到github上

选择后输入,点击clone

如何将webstrom本地的代码上传到github上

再继续点击

如何将webstrom本地的代码上传到github上

建议点击new window

如何将webstrom本地的代码上传到github上

此时,我们可以看到左上角出现了这个项目

如何将webstrom本地的代码上传到github上

新建一个文件,勾选要提交到git上面的index.html,点击ok

如何将webstrom本地的代码上传到github上

键入描述,然后点击commit and push

如何将webstrom本地的代码上传到github上

继续点击push

如何将webstrom本地的代码上传到github上

看到如下结果即表示push成功

如何将webstrom本地的代码上传到github上

7、刷新github页面,可以看到刚刚新增的文件

如何将webstrom本地的代码上传到github上

8、操作完毕