Git下载
地址: https://github.com/ 输入账号、邮箱、密码,然后点击注册按钮.
注册的时候最好取一个有意义的名字,比如姓名全拼,昵称全拼,如果被占用,可以加上有意义的数字. 本文中假设用户名为 ITmxs(我的博客名的全拼)
注册完成后,选择免费账号完成设置。
新建仓库
img
image-20200615074838697
输入仓库名,点击创建仓库,创建成功
image-20200615075034157
image-20200614203957047
image-20200614204133596
git add code.TXT
fatal: not a git repository (or any of the parent directories): .git
输入
git init
重新输入即可创建成功
image-20200614204757431
image-20200614205601551
找不到ssh-keygen命令是因为你的工作目录不在ssh-keygen.exe所在目录下,导致找不到命令,所以切换工作目录到ssh-kengen所在目录(Git/usr/bin/)即可。以我为例,我的Git安装在D盘Git下,所以进行操作 cd D:/Git/usr/bin/ ,然后执行 ssh-keygen -t rsa -C “您的邮箱地址” 即可
image-20200614212406139
image-20200614212327832
$ ssh-keygen -t rsa -C "17752170152@163.com" 按3个回车,密码为空。
image-20200614212022260
image-20200614213538320
img
image-20200614212725871
img
img
image-20200614213111283
其中Title中的名称可以任意填写,将C:\Users\luckly.ssh目录下id_rsa.pub复制的所有内容粘贴到Key中,点击Add SSH Key,SSH密钥完成
添加新的远程仓库
$ git remote add origin git@github.com/ITmxs/mygit.git其中红色部分的URL时是gihub中的SSH
远程提交完成!!!!!
image-20200614213538320
img
image-20200614211926084
image-20200614214040960
远程提交完成!!!!!