包括:git安装与IDEA中的配置,从云端导入项目,本地项目提交至云端,本地项目修改及更新提交。

一、安装及配置

官网下载链接:https://git-scm.com/download/win
或者百度网盘下载
链接:https://pan.baidu.com/s/1zLWFBmBj1KMw27e8A6On-Q
提取码:e12g

1、都默认就行,点点点。安装完成后win+R打开控制台,输入git命令,若安装成功,则IDEA使用git详细教程
2、下一步需要为IDEA指定git路径,File->settings->Version Control->Git
选择所安装的git.exe。
IDEA使用git详细教程
3、然后设置GitHub账号,File->settings->Version Control->GitHub
IDEA使用git详细教程
输入账号密码即可,
IDEA使用git详细教程
到此配置结束。

二、从GitHub中导入一个现成的项目(pull)

IDEA使用git详细教程
填写所需导入项目的网址:https://github.com/zhsun1995/pullTest.git
IDEA使用git详细教程
导入成功:
IDEA使用git详细教程

三、IDEA提交至GitHub

1、首先在GitHub上创建一个仓库,这个仓库相当于项目(project)
GitHub右上角位置
IDEA使用git详细教程
IDEA使用git详细教程
创建后得到仓库的地址:https://github.com/zhsun1995/myTest.git
IDEA使用git详细教程
2、创建一个本地的工程,或者随便找一个工程进行测试
IDEA使用git详细教程
3、然后创建本地仓库
IDEA使用git详细教程
IDEA使用git详细教程
4、提交项目至本地仓库(add)
IDEA使用git详细教程
Log显示
IDEA使用git详细教程
5、提交项目至云端
IDEA使用git详细教程
打开commit界面,在message栏输入自己想要的信息
IDEA使用git详细教程
注意不要点Commit,否则无法上传到GitHub,点了只是保存在本地库。
点击下箭头,选择Commit and Push
IDEA使用git详细教程
IDEA使用git详细教程
填写刚创建的仓库网址:https://github.com/zhsun1995/myTest.git
,Name也可进行修改,点击OK。
IDEA使用git详细教程
IDEA使用git详细教程
添加成功后的Log:
IDEA使用git详细教程
刷新仓库网址:https://github.com/zhsun1995/myTest
IDEA使用git详细教程

四、修改提交更新

对项目做任意修改
IDEA使用git详细教程
1、Ctrl+K 可直接打开上一步的commit界面
IDEA使用git详细教程
IDEA使用git详细教程
再次刷新网址
IDEA使用git详细教程
点击src->HelloClass.java可以看到所做的修改。
IDEA使用git详细教程

相关文章:

  • 2021-12-10
  • 2021-10-18
  • 2021-11-07
  • 2021-12-23
  • 2021-09-25
  • 2021-11-18
  • 2021-12-03
  • 2021-12-09
猜你喜欢
  • 2021-11-30
  • 2021-12-10
  • 2021-12-09
  • 2021-11-30
  • 2021-11-30
  • 2021-09-08
  • 2021-11-20
  • 2021-12-13
相关资源
相似解决方案