我有文件列表,我想获取特定时间范围内每个文件的提交列表或使用标记。
答案 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
你需要添加一些程序来检查那些时间框架内是否有提交。