Search code examples
gitgit-diffgit-log

git log shows added / removed - is there a way to show modified lines


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.


Solution

  • 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?