How do you get git bisect to ignore merged branches?

后端 未结 10 1244
长情又很酷
长情又很酷 2020-12-04 14:26

I\'m aware that git bisect is branch-aware by design, so that if between good commit, G, and bad commit, B, you merged in a branch, it needs to take those changes into consi

10条回答
  •  南笙
    南笙 (楼主)
    2020-12-04 14:58

    You can make git treat you history as linear using grafts. To linearize the whole first parent history you can use:

    git rev-list --first-parent --merges --parents HEAD | cut -d' ' -f1,2 > .git/info/grafts
    

    Just drop the grafts file when you're done with the bisection.

提交回复
热议问题