1

When we use the $ git log command, we can see how many lines added / removed for a file.

My question is - is there a way to inspect which lines were modified (neither added nor removed)? Or can only git diff do that?

Sort of a philosophical question, since a modified line could simply be considered to be removed then added.

2 Answers2

0

Currently, when this answer is written, git doesn't have any option to display line numbers and content which was modified in any way.

What you need to do is to write a script for this purpose.
The following answer supplies you with such a script:

Using git diff, how can I get added and modified lines numbers?

CodeWizard
  • 128,036
  • 21
  • 144
  • 167
0

It seems that what your are looking for could be achieved using --color-words option for git diff.

andrybak
  • 2,129
  • 2
  • 20
  • 40