用于特定文件的差异的Git日志

时间:2016-07-28 12:16:36

标签: 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
给出了一些改变某些/文件

的提交列表

即:

commit1  
Author
Date  
Commit message

commit2  
Author
Date
Commit message
...

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

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

1 个答案:

答案 0 :(得分:5)

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

git log -p path 
显示触摸指定路径的提交,并显示相同指定路径的差异。