1.创建github账户
2.设置
然后右键新建一个本地的工作文件夹(这个文件夹内用于存放需要提交的java项目) ,就是myLocalRepositories内的项目提交本地后,版本信息会到.git文件夹中,提交远程时候,本地库会提交到远程仓库。
创建好本地仓库和工作文件夹后,现在进入eclipse中设置git插件,我安装的eclipse默认已经有git插件,如果没有的可以到eclipse market中搜索安装,安装后,在window-preference中搜索git就可以看到相关设置信息了
接下来选择configurator,设置username和email,通过add entry添加key:username ,值设置为:xiaomifeng1010 ,key:email ,值设置为你的邮箱,apply and close
然后再windows-show view -others,搜索git,选择git repositories,Open
然后选择本地仓库的地址,从下拉列表中选择就可以了,path within repository(仓库中路径),从browse中选择mylocalRepositories文件夹(就是存放需要提交项目的文件夹),也是下边的target location
3.保存密匙
其中id_rsa是私钥,是自己电脑使用,id_rsa.pub是公钥,公钥待会要复制给GitHub使用,用来和本机进行验证,保存即可。然后再次进入GitHub网站,在个人头像下选择settings然后选择ssh and gpgkeys,点击new ssh key
此时进入GitHub,查看TestGit仓库,发现已经有了testAndReview这个项目了!
二.IDEA启动springboot项目
2运行结果
打开浏览器输入:http://localhost:8080/html/hello.html
三.SpringBoot 项目同步到对应Github仓库中
上传成功