如何使用标签获取文件的提交列表?

时间:2016-11-16 05:40:42

标签: git

我有文件列表,我想获取特定时间范围内每个文件的提交列表或使用标记。

2 个答案:

答案 0 :(得分:0)

git log <commit-range specification> -- path/to/file1 ... path/to/fileN

提交范围规范可能非常复杂。我建议阅读man git-log。如果您只需要提交列表(sha1和subject),您可能会发现git log的有用--pretty=oneline选项。

答案 1 :(得分:0)

git-log

的手册页引用
OPTIONS
   <since>..<until>
      Show only commits between the named two commits. When either <since>
      or <until> is omitted, it defaults to HEAD, i.e. the tip of the 
      current branch. For a more complete list of ways to spell <since> 
      and <until>, see gitrevisions(7).

以下命令将显示2016-11-16 10:00至2016-11-16 12:00 path/to/file1的日志

git log $(git rev-list -n 1 --until="2016-11-16 10:00")..$(git rev-list -n 1 --until="2016-11-16 12:00") -- path/to/file1

你需要添加一些程序来检查那些时间框架内是否有提交。

相关问题