1、Git下载及安装:https://jingyan.baidu.com/article/7f766dafba84f04101e1d0b0.html
2、GitHub注册账号:https://github.com/
3、idea上创建java项目
a.配置idea


b.idea上配置本地仓库

将本地仓库创建到哪里,这里配置到当前工作空间(一般选择当前项目工作空间下,否则后面将无法add)

c.上面配置好之后,你就会看到自己的项目会变红

d.此时进入该项目主目录下,Git Bash Here 下配置:
ssh-keygen -t rsa -C "邮箱名"
e.提示说:Could not create directory '/x/xxx/USERPROFILE/.ssh': No such file or directory,你应该在你项目主目录下创建一个USERPROFILE目录,然后三次回车,出现如下界面则成功

f. 然后你USERPROFILE目录下出现了生成了两个文件,将id_rsa.pub中内容复制到github上的SSH Keys中
g. Git Bash Here 中输入 ssh -T git@github.com验证设置是否成功,出现successfully关键字则成功!

h. 然后设置用户名,邮箱 【我这里自己用,所以用户名我就设置为git官网登陆的用户名,邮箱也是git注册的时候绑定的邮箱】
git config –global user.name “用户名”
git config –global user.email “邮箱”
i. 最后将已经配置好的项目上传到github上,然后到github上查看到以该项目命名的仓库
