简体   繁体   中英

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.

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?

看起来您正在寻找的东西可以使用git diff --color-words选项来实现。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM