如何显示在 git 中添加(和删除)的行数?

joh*_*nny 7 git

我必须显示所有提交添加(和删除)到某个文件的行数。

toh*_*ohu 8

使用git log --numstat --oneline <Filename>. 这将为您提供 file 的提交列表,<Filename>每个提交有两行,使用以下语法:

[sha hash] [commit title line]
[lines added] [lines removed] [path to file in repository]
Run Code Online (Sandbox Code Playgroud)