'git bisect'的正常用例是聲明引用的提示爲'bad'狀態,並搜索歷史記錄以查找最新的'good'狀態。這在搜索引入錯誤的提交時很有意義。Bisect找到_fixed_ bug的提交
但是,有時會在舊代碼中發現一個錯誤,它在最新的提交中已修復,問題是:哪個提交修復了此錯誤?有可能使用git bisect
,反義詞是「好」和「壞」,即將固定錯誤視爲「壞」狀態,將錯誤視爲「良好」狀態。但這有點令人困惑 - 在「良好」狀態下開始平分並尋找「壞」狀態可能會更清楚。但似乎並不喜歡這種方法:
$ git bisect start
$ git bisect good
$ git checkout <commit with known bug>
$ git bisect bad
Some good revs are not ancestor of the bad rev.
git bisect cannot work properly in this case.
Maybe you mistake good and bad revs?
什麼是處理這種情況的好方法?
可能的重複[我怎麼可以使用git bisect找到第一個好提交?](http://stackoverflow.com/questions/15407075/how-could-i-use-git-bisect-to-find-第一個好的承諾) – Zaz