【发布时间】:2012-08-10 14:39:57
【问题描述】:
如何查看文件夹中所有文件的 git 日志历史记录?
我找到了几篇关于如何显示特定文件的日志的帖子,但没有找到特定文件夹的帖子。
【问题讨论】:
标签: git
如何查看文件夹中所有文件的 git 日志历史记录?
我找到了几篇关于如何显示特定文件的日志的帖子,但没有找到特定文件夹的帖子。
【问题讨论】:
标签: git
您可以使用foldername 或foldername/*。无论哪种方式都应该有效。
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.
【讨论】:
path/to/folder下的目录?他们会出现吗?
*),它们肯定会出现
git log 只显示提交信息。如果您想查看文件更改,请提供上一条评论中提到的-p 标志
如果要使用图形工具,比如gitk,也是一样的:
gitk -- path/to/folder
【讨论】:
gitk 有一个非常实用的用户界面,但其他方面还不错。如果您喜欢漂亮的 UI,那么您还可以考虑 Sublime Text 团队的 Merge (WIN/MAC/*NIX) 和 Fork (WIN/MAC)。