5
如果我ls-tree
某棵樹,並得到一個blob和樹的列表,我怎麼能發現最後提交有關這些blob和樹?我正在尋找這樣的事情:如何根據blob/tree hash發現最後一次相關的提交?
$ git ls-tree HEAD
...
100644 blob 734713bc047d87bf7eac9674765ae793478c50d3 myfile
...
$ git show --commit 734713bc047d87bf7eac9674765ae793478c50d3
commit 734713bc047d87bf7eac9674765ae793478c50d3
Author: Scott Chacon <[email protected]>
Date: Fri Jan 2 18:32:33 2009 -0800
fixed refs handling, added gc auto, updated tests
[這個問題](http://stackoverflow.com/questions/223678/git-which-commit-has-this-blob)被問同樣的事情,並有一些答案,將讓你得到你想要的。當你瀏覽所有提交包含引用blob的提交時,它基本上是一個迭代過程。 – larsks
你能解釋爲什麼這篇文章沒有回答你的問題[哪個提交有這個blob?](http://stackoverflow.com/q/223678/11343) – CharlesB