了解文件上的git diff [英] Understanding git diff on files

查看:113
本文介绍了了解文件上的git diff的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

git diff 的含义是什么?

  diff --git a / README.md b / README.md 
index 24aa464..49c20f4 100644
--- a / README.md
+++ b / README.md
@@ -1,3 +1,2 @@
LINE1
-LINE2
LINE3

我想我明白 - 新的LINE2意味着工作区中的版本没有处于暂存状态的LINE2,但是 @@ - 1,3 +1,2 @@ 意思是

解决方案

差异与该大块有关,意思是/ README.md中的第1行至第3行以及b / README.md中的第1行至第2行。


What does the folowing output of git diff mean?

diff --git a/README.md b/README.md
index 24aa464..49c20f4 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,2 @@
 LINE1
-LINE2
 LINE3

I think I understand that the "-" new LINE2 means that the version on have in workspace does not have the LINE2 that is in staging, but what does @@ -1,3 +1,2 @@ mean??

解决方案

It is the line ranges that the diff is concerned with for that hunk, meaning lines 1 to 3 in a/README.md and lines 1 to 2 in b/README.md.

这篇关于了解文件上的git diff的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆