源文章 来自于知乎 https://zhuanlan.zhihu.com/p/27336403
最近学习git上传地项目至github,屡试不爽,今天进行总结,以便今后使用,过程如下:
1,打开github创建New repository

</figure>
2,创建项目名,项目说明,项目的公开性(public),创建项目库

</figure>
3,在本地项目的文件,右键 选择git bash Here,即直接指向项目文件夹

</figure>
4, 如果已存在,c盘用户去删除.ssh文件,或许指令删除;
终端里输入指令:mkdir .ssh 创建一个 .ssh 文件夹
cd .ssh 进入刚创建的 .ssh文件夹目录里
输入指令:ssh-Keygen -t rsa -C “123456
.com ”注册时的邮箱如23456 @qq .com
输入完成之后一直按回车键 中间会提示你要输入密码,不用管一直按回车直到出现这样。

</figure>
c盘 用户查看即可
5,输入ls -la验证配置是否成功,以下信息即success

</figure>
6,打开设置settings

</figure>
7,选择 SSH and GPG keys

</figure>
8,创建新的SSH密钥

</figure>

</figure>
9,打开.ssh文件中/.ssh/id_rsa.pub copy并粘贴至key中 保存,钥匙为灰色,

</figure>
》》输入ssh -T git@github.com指令 回车

</figure>
》》键入yes,提示succfully

</figure>
》》刷新网页密钥摇身一变

</figure>
10,在本地文件右键打开 git GUI here

</figure>
在Add Remote窗口中填写名字、Location。名字:newNameProject
Location:粘贴刚刚复制的Blog仓库路径;最后单击“Add”

</figure>

</figure>
等success之后;
将本地文件内容即“已缓存的改动”,提交git管理的master分支上。

</figure>
将本地文件上传到github上去
单击Git Gui界面“上传”--“上传”窗口随意勾选一个或多个传输选项--点击“上传”--上传Blog过程中需要输入github的登录账号和密码。

</figure>
提交看到success即可。。。。。
网友评论