Troy Whiteley On development and UI

7Feb/100

Finding Which Revision Broke A Build [GIT]

So someone broke something and you have no idea which revision it was. Git has a very handy way for you to figure it out. All you need to know is the revision number for a build that worked. Then you can use the git bisect command to find the bad revision.

$ git bisect start
$ git bisect bad #This current revision is bad
$ git bisect good df2cdf88a8b9fd8232880787b6de72de2f4efb20 # revision that was bad

You should then get some output like:

Bisecting: 467 revisions left to test after this

This will automatically checkout a revision somewhere in the middle of the revisions marked good and bad. This is when you will run a build and test if it broke. If it did:

$ git bisect bad

or if it succeeded:

$ git bisect good

Just continue this until git gives you the revision it thinks broke the build.

Source: Git documentation

   
Get Adobe Flash playerPlugin by wpburn.com wordpress themes