2019-06-17 比较工作区和暂存区文件的区别

[root@VM_0_3_centos project]# vim index.html
index
[root@VM_0_3_centos project]# vim style.css
css
修改工作区文件的内容
[root@VM_0_3_centos project]# git diff  #默认比较的是工作区和暂存区文件的区别
diff --git a/index.html b/index.html
index e69de29..9015a7a 100644
--- a/index.html
+++ b/index.html
@@ -0,0 +1 @@
+index
diff --git a/style.css b/style.css
index e69de29..dac138d 100644
--- a/style.css
+++ b/style.css
@@ -0,0 +1 @@
+css
git分为工作区、暂存区和版本库
[root@VM_0_3_centos project]# git diff index.html  #指定比较哪个文件
diff --git a/index.html b/index.html
index e69de29..9015a7a 100644
--- a/index.html
+++ b/index.html
@@ -0,0 +1 @@
+index
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容