前置知识,如何创建一个账号新建一个仓库, 这些都可以百度到
git ====== 生成秘钥
ssh-keygen -t rsa -C "1037428670@qq.com"
ps: 在电脑桌面空白处右键 git bash here 进入git 命令行 输入上面的命令行
image.png
》》第二步就是添加秘钥到github
复制生成的秘钥


打开github仓库界面进入settings

打开deploy keys

添加秘钥

将复制的秘钥粘贴这里就可以了

成功后就是这样的

接下来就是clone 和提交
回到git命令行 git bash here 输入以下指令验证是否成功
ssh -T git@github.com
显示以下图片则表明验证成功
image.png
接下来是利用git命令上传代码
1.在PC桌面空白处点击右键 》git bash here
2.复制github仓库的clone地址

3.在命令行输入 git clone git@github.com:zhangpengfei1990/safeProduct.git
(注意复制的网址只要后面的一部分)

4.接下来你的电脑桌面就完整的将项目clone到了本地,修改一些文件,保存后利用git命令行上传上去(下图为新建的文件)

5.>> 命令行
》git pull 检查线上仓库版本是否变更 下载
》git add . 添加
》git commit -m "new html" 新增文件描述
》git push 提交
网友评论