Git+IDEA 小灰灰 2022-06-10 08:25 150阅读 0赞 # 1、Git初始化 # -------------------- 1. git初始化 注:git的安装在此不作演示,各位同学自行学习。 安装成功之后桌面点击右键,选择Git Bash Here,键入git,出现以下内容: ![git安装成功界面][git] 则说明安装成功。 2. git注册 键入:git config –global user.name “你的用户名” 键入:git config –global user.email “你的github登录邮箱” 3. 配置Windows SSH服务 键入:ssh-keygen -t rsa -C “你的github登录邮箱” ![这里写图片描述][SouthEast] 然后在C盘下面会生成如图文件 ![这里写图片描述][SouthEast 1] 4. 添加ssh,打开.pub文件 ![这里写图片描述][SouthEast 2] -------------------- # 2、IDEA部份 # 1. 配置git ![这里写图片描述][SouthEast 3] 2. 在github上创建新的远程仓库 ![这里写图片描述][SouthEast 4] 3. IDEA中新建一个项目 ![这里写图片描述][SouthEast 5] 4. 找到项目对应的文件夹 ![这里写图片描述][SouthEast 6] 5. 右键点击Git Bash Here, 依次输入以下命令 git init git add src git commit -m “first commit” git remote add origin [https://github.com/fanezhao/MySpringboot.git][https_github.com_fanezhao_MySpringboot.git] git push -u origin master 如果第一次没有错误的话会提示输入用户名,密码。 ![这里写图片描述][SouthEast 7] 6. 检查github,已经上传成功 ![这里写图片描述][SouthEast 8] 7. 新建b.txt ![这里写图片描述][SouthEast 9] 8. 提交到本地 ![这里写图片描述][SouthEast 10] 9. 添加提交说明并点击commit ![这里写图片描述][SouthEast 11] 注意此时只是提交到本地,并没提交到远程仓库 10. push到远程仓库(Ctrl+Shift+K) ![这里写图片描述][SouthEast 12] 点击push上传到远程仓库 11. 检查github,上传成功 ![这里写图片描述][SouthEast 13] 注意:IDEA在第一次使用git push到远程仓库时会需要输入用户名密码。 参考: > [http://www.cnblogs.com/java-maowei/p/5950930.html][http_www.cnblogs.com_java-maowei_p_5950930.html] [git]: /images/20220610/5bf286dc000d4d6e99a899960fd91fd1.png [SouthEast]: /images/20220610/f6ace238c9454ccb8fda0a48a07281d4.png [SouthEast 1]: /images/20220610/4cfb7f38d03b447a94558956c7425438.png [SouthEast 2]: /images/20220610/27cfcdeeb8f54a6d83b3603d004ef9f3.png [SouthEast 3]: /images/20220610/8135a10701984e6da0618665104f8a62.png [SouthEast 4]: /images/20220610/8fc51e36a581417f83152758f0140256.png [SouthEast 5]: /images/20220610/0dc19c31c1fa4250859e19bccb89679c.png [SouthEast 6]: /images/20220610/c94bac7ccc8248e789ed0d1c3a00df82.png [https_github.com_fanezhao_MySpringboot.git]: https://github.com/fanezhao/MySpringboot.git [SouthEast 7]: /images/20220610/fec92c074a9d47bbaa18a804a2e59deb.png [SouthEast 8]: /images/20220610/6bf6c54650064d6c99408e50600d5ee0.png [SouthEast 9]: /images/20220610/a49009d3e915414bb91c0d6917230c49.png [SouthEast 10]: /images/20220610/70512ebc3633443aa4944b45c5a4e7ee.png [SouthEast 11]: /images/20220610/f7579d9fabb94a779707f480f85ebe2b.png [SouthEast 12]: /images/20220610/fa905b86522b4a4381926d7e5891f730.png [SouthEast 13]: /images/20220610/1e39290087be4d2bb705026be793175a.png [http_www.cnblogs.com_java-maowei_p_5950930.html]: http://www.cnblogs.com/java-maowei/p/5950930.html
还没有评论,来说两句吧...