Using Git bisect to quickly locate and introduce the wrong version

Source: Internet
Author: User
Tags using git
Now there is a project, in the development of the day, by an engineer introduced a bug, take the system and not go, directly lock the database connection. The project uses the Java Platform for version management on SVN. I do not want a version of code review troubleshooting, think of the most violent binary version of the method, of course, in SVN to do means to a version checkout out, so big project, is also very time-consuming, at this time, Git-bisect is my only choice.

First, export the SVN repository as a git library:
$ git svn clone-s http://svn.xxx.com/svn/xxxxx
Then, start git bisect:
$ git bisect start
Mark the current version as error:
$ git bisect bad
Find the version of the previous day, do a tag (tag20090106), test for the correct, mark it:
$ git bisect good tag20090106
At this point git will tell you to choose an intermediate version, then start compiling, testing, if not, execute:
$ git bisect bad
Git will use the binary method to look forward to an intermediate version, start compiling, testing, if passed, execute:
$ git bisect good
Git will continue to locate revision until it finally navigates to a bug-introducing version, then analyze the reason, and then find the troublesome engineer Pk,pk finished back to the end of the execution:
$ git bisect reset
Git will return to the current head.
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.