CodeRef
CodeRef
  • Software
    • VSCode
  • Midjourney_AI
    • Midjourney Cheat Sheet
  • aws
    • S3 Reference
    • Services
  • bash
    • .bashrc File Contents
    • CAN
    • _System Config File Locations
    • argument-length-limits
    • Conditionals
    • Data Structures
    • File Permissions
    • File Syncing
    • File System
    • Functions
    • General
    • Loops
    • My Functions
    • Networking
    • Number Operations
    • OpenVPN
    • Operators
    • Resource Management
    • Serial RS232
    • Spinning Wheel Animation
    • SSH
    • Text Operations
    • Environment Variables
  • cpp
    • ChatGPT | Pointers vs. References
    • arrays
    • Classes
    • Data Types / Structures
    • Enumerated Classes
    • Exception Handling
    • Function Objects
    • Functions
    • I/O
    • Loops
    • Macros
    • Namespaces
    • New Features
    • Pointers
    • Scope
    • Smart Pointers
    • Raw String Literals
    • Style Guide
    • Switch Case
    • Templating
    • How to Use tinyxml2
    • Useful Libraries
    • google-test
    • Conditionals
    • Rule of Three/Five
    • Optional Parameters
    • Keywords
    • Filesystem
    • Random
    • Casting
    • tools
  • git
    • Code Review Dependency Strategy
    • Git Bisect Guide
    • Git Reference
    • removing-cherry-picks
    • Useful Tools
    • Graphite Reference
  • js
    • functions
    • Javascript Reference
  • linux
    • Display
    • Dual Boot with Windows
    • File System
    • NVIDIA
    • Sending/Receiving TCP/UDP Messages in Ubuntu
    • dynamically_linked_binaries
  • markdown
    • Images
    • obsidian-reference
  • python
    • Classes
    • Exceptions
    • Functions
    • Operations
    • Python Reference
    • unittest_command-line-args
    • unittest_magicmock_GPT
    • unittest_mock
    • unittest_printing
    • unittest_subtest
    • useful-stuff
    • jupyter
    • poetry
  • ros
    • _ROS Cheat Sheet
    • Create New Workspace
    • Install ROS
    • Node Sample - Listener
    • Node Sample - Talker
    • Node Template
    • Setup
    • urdf
  • excel
    • excel-reference
  • windows
    • File System
    • WSL - Windows Subsystem for Linux
    • WSL
  • software_engineering
    • uncle_bob_lectures
      • Overview
      • Lesson 01 - Notes
  • web
    • Front End
    • Hugo
    • new_frontend_tools
  • sql
    • cheatsheet
Powered by GitBook
On this page
  1. git

Git Bisect Guide

ChatGPT 3.5.

Here's a step-by-step guide with the commands to perform the process of bisecting using git bisect:

  1. Start Bisecting:

    • Specify the known "good" commit:

      git bisect start
      git bisect good <good_commit>
    • Specify the known "bad" commit (or HEAD if the bug is present in the latest commit):

      git bisect bad <bad_commit>

    Git will now check out a commit roughly halfway between the "good" and "bad" commits.

  2. Test:

    • Test whether the bug is present in the current commit.

    • If the bug is present, mark the current commit as "bad":

      git bisect bad
    • If the bug is not present, mark the current commit as "good":

      git bisect good

    Git will then narrow down the search space and check out the next commit for testing.

  3. Repeat:

    • Repeat the testing and marking process (steps 2) until Git identifies the commit that introduced the bug.

    • Git will automatically narrow down the search space by selecting commits between the "good" and "bad" commits.

  4. Finish Bisecting:

    • Once Git identifies the specific commit that introduced the bug, it will output the commit hash.

    • You can then inspect the identified commit to understand what changes caused the bug.

    • To end the bisecting process and return to the original state, use:

      git bisect reset

These commands will guide you through the process of bisecting with git bisect, allowing you to efficiently identify the commit that introduced a bug in your codebase.

Last updated 1 year ago