如果我 ls-tree
某棵树并获得 blob 和树的列表,我如何才能发现与这些 blob 和树相关的最后一次提交?我正在寻找这样的东西:
$ git ls-tree HEAD
...
100644 blob 734713bc047d87bf7eac9674765ae793478c50d3 myfile
...
$ git show --commit 734713bc047d87bf7eac9674765ae793478c50d3
commit 734713bc047d87bf7eac9674765ae793478c50d3
Author: Scott Chacon <schacon@gmail.com>
Date: Fri Jan 2 18:32:33 2009 -0800
fixed refs handling, added gc auto, updated tests
最佳答案
我有点困惑。我不明白你为什么需要这样的东西。但是,我认为这就是你想要的-
git ls-tree --name-only HEAD | while read file; do git log -n 1 --date=short --pretty="$file, author: %an, commit: %h, date: %ad, msg: '%s'" -- $file; done
关于git - 如何根据 blob/tree hash 发现最近的相关提交?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10585816/