进入到github,省略掉创建账号等步骤点击主页绿色按钮 new
![](https://img-blog.csdnimg.cn/img_convert/f23b2e460a36cf7e9f87996e8e93f1e8.png)
点击完之后会出现以下页面
![](https://img-blog.csdnimg.cn/img_convert/ce29905040702fdacbd77a8608da1488.png)
我们所需要填写的就是自己项目的名字
![](https://img-blog.csdnimg.cn/img_convert/78d22fdb781fa3882a7bb7443c451901.png)
然后选择自己的仓库类型 请根据自己的需求准确的选择项目类型
![](https://img-blog.csdnimg.cn/img_convert/3658a973532ac84f679857b287d741a8.png)
选择好仓库类型以后就可以提交自己的仓库
![](https://img-blog.csdnimg.cn/img_convert/c9032ce08afa0a3a5e8b843411fa2ece.png)
创建成功示例
![](https://img-blog.csdnimg.cn/img_convert/03ec6b9047135df130f08f45e56fc82f.png)
到了这一步就完成了新仓库的创建,接下来就要连接我们的项目和仓库
接下来我们要找到自己的项目文件在里面右键
![](https://img-blog.csdnimg.cn/img_convert/086811c5c1ecc0f303dd2859b60c6857.png)
这样我们会打开一个运行窗口
![](https://img-blog.csdnimg.cn/img_convert/078a48be4868b8c245b582719a9eb371.png)
在里面首先输入 git init 初始化git
![](https://img-blog.csdnimg.cn/img_convert/b4a516931cfb09ff66b013a7c3fa70fb.png)
这时我们的项目里面会生成一个git文件 这是一个隐藏文件需要我们手动去打开
![](https://img-blog.csdnimg.cn/img_convert/8471fa42d8f12a4b96df69de6ead194f.png)
这之后我们按照刚才创建好的新的仓库 按照命令一步一步执行
![](https://img-blog.csdnimg.cn/img_convert/a14a53777686317a627b0ff72ed48e99.png)
这样就把项目提交到仓库内了
之后就是配置秘钥
点击自己的头像然后点击settings
![](https://img-blog.csdnimg.cn/img_convert/a1b665bb2d9d96947126d2b6429cf400.png)
之后找到一个小钥匙图案点击
![](https://img-blog.csdnimg.cn/img_convert/bb7e237bc4db76a390912d2e170d492d.png)
然后要找到自己的秘钥
在刚才的命令框输入 ssh-keygen -t rsa -C "github 登录账号"
![](https://img-blog.csdnimg.cn/img_convert/3fd7f9e980bd0594e54367f8663358e4.png)
从这个路径找到自己的秘钥然后复制粘贴到刚才的小钥匙页面 要设置个秘钥的名字
设置好之后就可以使用了
![](https://img-blog.csdnimg.cn/img_convert/82848787c1458bf6792d96e4865c41e5.png)