1

I am wondering why git log only shows lines added/deleted, but no modified lines.

For example,I type

git log commit1..commit2 --stat

the result is

commit 5b5h5.........
 Author: cc <cc@mail.com>
Date:    Wed May 28 13:36:34 2014 +0800
         some commit message
   code/src/com/bocom/..../file
    1 files changed, 1 insertion(+), 1 deletion(-)

But in fact,I just modified something in the same line, not deleting or adding any new line.It is strange.

So does anyone know some git command to get the correct modified lines including (added ,deleted,modified) ?

sleske
  • 81,358
  • 34
  • 189
  • 227
Venus
  • 1,184
  • 2
  • 13
  • 32
  • possible duplicate of [Is there a way of having git show lines added, lines changed and lines removed?](http://stackoverflow.com/questions/9933325/is-there-a-way-of-having-git-show-lines-added-lines-changed-and-lines-removed) – sleske May 29 '14 at 07:07

2 Answers2

0

git is indicating that the file has been modified.

git isn't tracking modifications inside of the line level. Instead it's indicating that the original line has been deleted, and a new one has taken it's place.

rjpower
  • 463
  • 4
  • 13
0

Not directly a git command but there is a tool called diffstat which can take git diff's as input and show the number of modified lines.

ains
  • 21
  • 2