Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Doing a git bisect and one of the commits doesn't build

Tags:

git

git-bisect

I'm trying to find a problem in the app I'm working on and I started to do a git bisect. There are 9 steps to the bisect so 256+ commits that could potentially cause this issue.

However, one of the git bisect steps checked out a commit that wouldn't build. Because it was committed before being run and not fixed. The next commit fixed the build problem.

Is it possible to move the git bisect onto the next commit and then continue running git bisect?

like image 525
Fogmeister Avatar asked Feb 18 '18 10:02

Fogmeister


People also ask

How do I remove a bad commit in git bisect?

Use git log to check the previous commits. Use Git Bisect to find the commit in which line 2 is changed from 'b = 20' to 'b = 0.00000'. Remove the bad commit by using Git Revert. Leave the commit message as is.

How does git bisect work?

git bisect performs a binary search to find the faulty commit. Git bisect requires the user to input the “good” commit and the “bad” commit, and then performs a binary search on the commits, starting with the commit that is at the midpoint between the “good” and “bad” commit.

How do you reset a bisect?

To do this first run git bisect reset , this will end your bisect session. Now you can start over by running git bisect start and then marking a good and bad commit, which then will start the iterative process of marking commits selected by bisect good or bad again.


1 Answers

Just say git bisect skip to "skip" the commit you can't build. It knows what to do, and will choose another commit to try.

like image 195
John Zwinck Avatar answered Sep 24 '22 03:09

John Zwinck