166

如何查看文件夹中所有文件的 git log 历史记录?

我找到了几篇关于如何显示特定文件的日志的帖子,但没有找到特定文件夹的帖子。

4

2 回答 2

223

您可以使用foldernamefoldername/*。无论哪种方式都应该有效。

git log -- path/to/folder
git log -- path/to/folder/*

此方法不会跟踪重命名文件的历史记录。

请注意,这--也是可选的。(来自 git log 手册)

[--] <path>...

           Show only commits that are enough to explain how the files that match the specified paths came to be. See History Simplification below for
           details and other simplification modes.

           Paths may need to be prefixed with -- to separate them from options or the revision range, when confusion arises.
于 2012-08-14T10:18:38.947 回答
65

如果你想使用图形工具,比如 gitk,它的工作原理是一样的:

gitk -- path/to/folder
于 2013-11-14T17:33:27.410 回答