Giter Site home page Giter Site logo

git-bisect-practice's Introduction

Git Bisect Practice

This repository is created for practicing the use of git bisect to find a bug in a codebase. The code in this repository intentionally contains a bug that needs to be identified using git bisect.

Getting Started

To get started with the project, follow these steps:

  1. Clone the repository:

    git clone https://github.com/your-username/git-bisect-practice.git
    
  2. Open the project in your preferred code editor.

  3. Familiarize yourself with the codebase and the bug that needs to be identified.

Usage

  1. Start the git bisect process by running the following command:

    git bisect start
    
  2. Identify a commit where the bug didn't exist. You can use git log to view the commit history and find a suitable commit. Copy the commit hash of that commit. Press Ctrl + C OR q OR Esc key followed by :q to return you to the command prompt

  3. Mark the current commit as bad by running the following command:

    git bisect bad
    
  4. Mark the commit you identified in step 2 as good by running the following command (replace <commit-hash> with the actual commit hash):

    git bisect good <commit-hash>
    
  5. Git will automatically checkout a commit in between the good and bad commits. Test the code to determine if the bug exists in that commit.

  6. If the bug exists in the checked-out commit, mark it as bad by running:

    git bisect bad
    
  7. If the bug doesn't exist in the checked-out commit, mark it as good by running:

    git bisect good
    
  8. Repeat steps 5-7 until git bisect identifies the commit that introduced the bug. Git will perform a binary search through the commit history, automatically checking out commits for you to test.

  9. Once git bisect identifies the bad commit, it will display the commit hash and additional information. You can use git show <commit-hash> to view the changes made in that commit and understand what caused the bug.

  10. Analyze the changes made in the bad commit to identify the bug and fix it accordingly.

  11. End the git bisect process by running the following command:

    git bisect reset
    
  12. Continue practicing git bisect with other bugs or revert the codebase to its original state.

Contributing

Contributions are welcome! If you have any suggestions or improvements, please open an issue or submit a pull request.

License

This project is licensed under the MIT License.

git-bisect-practice's People

Contributors

kit0-0 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.