2012-05-22 79 views

回答

10

下面的腳本應該做的伎倆:

#!/bin/sh 

blob=deadbeefdeadbeefdeadbeefdeadbeef 

git rev-list --all | 
while read commit; do 
    if git ls-tree -r $commit | grep -q $blob; then 
     echo $commit 
    fi 
done 
0

也許有點晚,但git show <abbrev-sha1>將表明,斑點等等的內容將git cat-file blob <abbrev-sha1>,使用git cat-file -t <abbrev-sha1>來檢查它的一個blob。

獲得第一(或最後)提交包含它似乎不是那麼容易(如補丁的差異index線,其中該修補程序的來源確定)