带有差异的 Git 日志用于某个文件

标签 git git-diff git-log

如何获得结合每次提交差异的日志列表
即:

commit1  
Author
Date  
Commit message
changes between commit1 and commit2

commit2  
Author
Date
Commit message
changes between commit2 and commit3
...

使用
git log/some/file
列出更改了 some/file 的提交

即:

commit1  
Author
Date  
Commit message

commit2  
Author
Date
Commit message
...

但是,每次提交中的更改不会显示

使用
git diff hash1..hash2/some/file
给出这两次提交之间/some/file 中的更改。
但仅在这 2 次提交之间,而不是通过所有更改/some/file 的提交

最佳答案

根据 https://git-scm.com/docs/git-log你可以使用

git log -p path 
显示涉及指定路径的提交,以及关于相同指定路径的差异。

关于带有差异的 Git 日志用于某个文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38636105/

相关文章:

git - 如何只获取一个分支的提交历史?

git - 如何用更少的内容在单独的缓冲区中显示长 git 输出?

git - git 文档中的 'unwrapped subject and body' 对于 %B pretty-print 说明符是什么意思

git - 将 Git Diff 限制为一项或多项功能?

git - 如何查看工作目录和暂存索引之间的差异?

git - 在我的终端中并排着色的内联 git diff 输出

Vim:退出拆分窗口时删除缓冲区

GIT预接收 Hook

Git:阻止外部用户访问特定分支

git - 使用 Git 的常见反模式有哪些?