配置操作

  1. 打开IDEA,创建一个新的项目,在IDEA右上角的File中选择Settings
    IDEA之Git的运用
  2. 选择Version Control中的Git
    IDEA之Git的运用
  3. 选择你本地安装的Git的路径
    IDEA之Git的运用
  4. 本地库的初始化操作:选择VCS->Import into Version Control->Create Git Respository
    IDEA之Git的运用
    在弹出框选择指定文件位置,就可以查看到文件生成一个.git
    IDEA之Git的运用
  5. 将模块添加到add中,选择一个目录,然后右键,会看到一个git->add
    IDEA之Git的运用
  6. 将模块commit,对准模块右键git->commit diretory
    IDEA之Git的运用
  7. 填写相关信息,其中Commit Message就是描述确认信息
    IDEA之Git的运用
  8. 在控制台中可以查看信息
    IDEA之Git的运用

IDEA克隆项目操作

IDEA之Git的运用
IDEA之Git的运用


IDEA拉取项目操作

  1. 拉去远程库的操作
    打开项目的文件夹,右键打开终端,执行拉取操作git pull (别名) (分支) --allow-unrelated-histories
    在git 2.9.2版本之后,需要添加–allow-unrelated-histories,告诉版本允许不相关历史合并
    IDEA之Git的运用
    点击键盘 “ i ” 按钮,编辑信息,按ESC,输入:wq保存退出
    IDEA之Git的运用
    文件夹中添加了拉取的文件
    IDEA之Git的运用
  2. 在IDEA中提交代码
    右键项目,选择git->repository->push
    IDEA之Git的运用
  3. 填写远程库地址
    IDEA之Git的运用
    IDEA之Git的运用
    IDEA之Git的运用
  4. 点击Push,发送到远程仓库
    IDEA之Git的运用

相关文章:

  • 2022-01-13
  • 2022-12-23
  • 2022-12-23
  • 2021-05-21
  • 2021-05-09
  • 2021-11-08
  • 2021-08-21
  • 2021-09-19
猜你喜欢
  • 2022-02-21
  • 2021-04-08
  • 2021-11-18
  • 2021-08-02
  • 2021-08-13
  • 2021-05-30
  • 2021-08-20
相关资源
相似解决方案