介绍
idea的Terminal中默认调用的是操作系统的cmd命令。这里为了使用git管理更方便一点,将Terminal修改为调用git-cmd命令,具体步骤如下
git的重要性
这里不用再赘述了吧,开发的小伙伴应该都明白,为啥不用svn,自行百度!
安装git
请在浏览器中输入【Git安装教程】,对着安装就好,很简单
重头戏,在idea中配置Terminal
- 在idea中配置下git
- 修改Terminal调用的命令
3 用起来
4 多敲一些命令玩玩
D:\workspace\demo>Git add .
warning: LF will be replaced by CRLF in .gitignore.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in .mvn/wrapper/MavenWrapperDownloader.java.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in .mvn/wrapper/maven-wrapper.properties.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in mvnw.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in mvnw.cmd.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in pom.xml.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/main/java/com/zyu/boot/demo/DemoApplication.java.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/main/resources/application.yml.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/test/java/com/zyu/boot/demo/DemoApplicationTests.java.
The file will have its original line endings in your working directory
D:\workspace\demo>git commit -am "搭建springboot基础项目"
[master (root-commit) 347c29c] 搭建springboot基础项目
11 files changed, 785 insertions(+)
create mode 100644 .gitignore
create mode 100644 .mvn/wrapper/MavenWrapperDownloader.java
create mode 100644 .mvn/wrapper/maven-wrapper.jar
create mode 100644 .mvn/wrapper/maven-wrapper.properties
create mode 100644 mvnw
create mode 100644 mvnw.cmd
create mode 100644 pom.xml
create mode 100644 src/main/java/com/zyu/boot/demo/DemoApplication.java
create mode 100644 src/main/java/com/zyu/boot/demo/controller/TestController.java
create mode 100644 src/main/resources/application.yml
create mode 100644 src/test/java/com/zyu/boot/demo/DemoApplicationTests.java
D:\workspace\demo>git status
On branch master
nothing to commit, working tree clean
扩展
确实这么配置之后,用起git来很方便。Git在项目管理中很重要,其他的高级用法,可以自行百度琢磨。这个不只是可以配置git,还可以配置其他个性化的操作,期待小伙伴们的分享!!!