1、注册github新建仓库

2、配置ssh秘钥 这个操作就是让我们的电脑和github进行一个绑定验证 1. 右键->Git Bash Here 2. 需要配置ssh 命令:ssh-keygen -t rsa -C "email@qq.com" 3. 默认上次回车就好,出现如下界面即生成了ssh密钥

3、打开秘钥文件,copy
4、到github设置中,新建秘钥,


这个操作,一台电脑不主动删除的话,只需要执行一次

5、设置username和email,因为github每次commit都会记录他们 输入:git config --global user.name "your name" 注册时填写的名字 git config --global user.email "email@qq.com" 自己的邮箱

6、在项目文件夹下右键进入git bash命令行

7、获取远程仓库连接地址,使用git remote add origin连接创建好的远程仓库

8、使用git init将这个项目路径变为git仓库,再通过git add .将文件添加到该仓库,使用 git commit -m "first commit"将项目提交到本地仓库,引号为本次操作的注解,尽量见名知意
9、使用git push将项目上传到远程仓库
网友评论