前言:
以前做项目都是最后写完整体上传github,这样不太好,对于团队协作和版本控制都无法做到管理,所以这回准备做一个开源项目,使用git来进行控制。下面记录一下使用的过程。
git相关
什么是git呢?Git是目前世界上最先进的分布式版本控制系统。要使用git我们需要在我们的系统上安装git。具体安装看这篇文章,和github是一样的。
idea连接github
按照上面的步骤成功安装git后,我们就可以使用idea连接github了。
1. 指定本地git路径
步骤:打开File - > Version Control -> Git 在Path to Git executable:添加你的git安装的路径\bin\git.exe
![在这里插入图片描述 [Git] IDEA连接GITHUB上传项目_git](https://file.cfanz.cn/uploads/png/2022/08/30/6/U0f27aR73W.png)
2. 连接github
步骤:打开File - > Version Control -> GitHub 进行连接到你自己的github账号即可
![在这里插入图片描述 [Git] IDEA连接GITHUB上传项目_上传_02](https://file.cfanz.cn/uploads/png/2022/08/30/6/4LBdc19O12.png)
3. 创建仓库
步骤:VCS -> Import into Version Control -> create Git Repository
![在这里插入图片描述 [Git] IDEA连接GITHUB上传项目_上传_03](https://file.cfanz.cn/uploads/png/2022/08/30/6/ULD14HY2ba.png)
4. 上传工程
步骤:VCS -> Import into Version Control -> share Project on github
![在这里插入图片描述 [Git] IDEA连接GITHUB上传项目_上传_04](https://file.cfanz.cn/uploads/png/2022/08/30/6/X6RNOJW9dG.png)
5. 进行上传修改操作
遵循git的方式:先add后commit最后push
步骤::VCS -> Import into Version Control -> git -> add
![在这里插入图片描述 [Git] IDEA连接GITHUB上传项目_上传_05](https://file.cfanz.cn/uploads/png/2022/08/30/6/044D5340B1.png)
![在这里插入图片描述 [Git] IDEA连接GITHUB上传项目_github_06](https://file.cfanz.cn/uploads/png/2022/08/30/6/O0966dSTPc.png)
![在这里插入图片描述 [Git] IDEA连接GITHUB上传项目_github_07](https://file.cfanz.cn/uploads/png/2022/08/30/6/33054S6fS7.png)
6. 更新操作
![在这里插入图片描述 [Git] IDEA连接GITHUB上传项目_git_08](https://file.cfanz.cn/uploads/png/2022/08/30/6/BBPJ99Vc63.png)
总结
这是相关的使用过程,这只是初级使用,具体进阶还需要自己学习的。










