配置git

在这里插入图片描述

创建git仓库

在这里插入图片描述

不同颜色代表的含义

在这里插入图片描述

  • 红色——未加入版本控制;
  • 绿色——已经加入控制暂未提交;
  • 蓝色——加入,已提交,有改动;
  • 白色——加入,已提交,无改动;
  • 灰色——版本控制已忽略文件;
  • 黄色——被git忽略,不跟踪。

添加文件到暂存区

在这里插入图片描述
文件在没有被添加到暂存区的时候,是红色的;添加到暂存区之后,是绿色的

提交到仓库

文件右键
在这里插入图片描述
或者通过导航栏(原来的VCS已经变成了Git)
在这里插入图片描述
在这里插入图片描述
提交之后文件会从绿色变为白色

修改文件

文件会变蓝色
可以直接提交,不需要再次添加

点击右侧不同,还可以回退或者查看不同
在这里插入图片描述

新建文件

在这里插入图片描述

查看版本历史

在这里插入图片描述
在这里插入图片描述

查看git记录

在这里插入图片描述

18:24:28.488: [FileUpload] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false init
Initialized empty Git repository in D:/IDEA_Project/FileUpload/.git/
18:25:18.272: [FileUpload] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false add --ignore-errors -A -- FileUpload.iml out/artifacts/FileUpload_war_exploded/index.html .idea/.gitignore .idea/runConfigurations.xml out/artifacts/FileUpload_war_exploded/META-INF/MANIFEST.MF .idea/misc.xml out/artifacts/FileUpload_war_exploded/WEB-INF/web.xml src/main/java/version4/Upload4.java .idea/jarRepositories.xml .idea/compiler.xml .idea/artifacts/FileUpload_war_exploded.xml web/index.html web/WEB-INF/web.xml pom.xml
18:25:18.560: [FileUpload] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false add --ignore-errors -A -- .
warning: LF will be replaced by CRLF in out/artifacts/FileUpload_war_exploded/WEB-INF/web.xml.
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 web/WEB-INF/web.xml.
The file will have its original line endings in your working directory
18:29:49.582: [FileUpload] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false add --ignore-errors -A -f -- .idea/runConfigurations.xml pom.xml FileUpload.iml .idea/.gitignore .idea/artifacts/FileUpload_war_exploded.xml .idea/misc.xml src/main/java/version4/Upload4.java web/index.html .idea/jarRepositories.xml out/artifacts/FileUpload_war_exploded/META-INF/MANIFEST.MF .idea/compiler.xml out/artifacts/FileUpload_war_exploded/WEB-INF/web.xml web/WEB-INF/web.xml out/artifacts/FileUpload_war_exploded/index.html
18:29:49.712: [FileUpload] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false commit -F C:\Users\gao\AppData\Local\Temp\git-commit-msg-.txt --
[master (root-commit) f61e227] 第一次提交
 14 files changed, 216 insertions(+)
 create mode 100644 .idea/.gitignore
 create mode 100644 .idea/artifacts/FileUpload_war_exploded.xml
 create mode 100644 .idea/compiler.xml
 create mode 100644 .idea/jarRepositories.xml
 create mode 100644 .idea/misc.xml
 create mode 100644 .idea/runConfigurations.xml
 create mode 100644 FileUpload.iml
 create mode 100644 out/artifacts/FileUpload_war_exploded/META-INF/MANIFEST.MF
 create mode 100644 out/artifacts/FileUpload_war_exploded/WEB-INF/web.xml
 create mode 100644 out/artifacts/FileUpload_war_exploded/index.html
 create mode 100644 pom.xml
 create mode 100644 src/main/java/version4/Upload4.java
 create mode 100644 web/WEB-INF/web.xml
 create mode 100644 web/index.html
18:31:29.597: [FileUpload] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false add --ignore-errors -A -- src/main/java/version4/Upload4.java
18:33:21.589: [FileUpload] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false add --ignore-errors -A -- src/main/java/version4/Test1.java
18:36:33.726: [FileUpload] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false add --ignore-errors -A -f -- src/main/java/version4/Test1.java src/main/java/version4/Upload4.java
18:36:33.862: [FileUpload] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false commit -F C:\Users\gao\AppData\Local\Temp\git-commit-msg-.txt --
[master fb72771] 第二次提交
 2 files changed, 9 insertions(+)
 create mode 100644 src/main/java/version4/Test1.java
18:37:05.852: [FileUpload] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false add --ignore-errors -A -f -- src/main/java/version4/Upload4.java
18:37:05.985: [FileUpload] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false commit -F C:\Users\gao\AppData\Local\Temp\git-commit-msg-.txt --
[master eb6ec4c] 第三次提交
 1 file changed, 1 insertion(+)
Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐