{"id":25490183,"url":"https://github.com/fix2015/bisect","last_synced_at":"2026-01-26T23:24:54.867Z","repository":{"id":265962233,"uuid":"896960209","full_name":"fix2015/bisect","owner":"fix2015","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-14T17:56:45.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-14T18:39:42.545Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fix2015.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-01T18:13:51.000Z","updated_at":"2024-12-14T17:56:49.000Z","dependencies_parsed_at":"2024-12-01T20:34:21.259Z","dependency_job_id":null,"html_url":"https://github.com/fix2015/bisect","commit_stats":null,"previous_names":["fix2015/bisect"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fix2015%2Fbisect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fix2015%2Fbisect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fix2015%2Fbisect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fix2015%2Fbisect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fix2015","download_url":"https://codeload.github.com/fix2015/bisect/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239552866,"owners_count":19658003,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-18T21:27:28.158Z","updated_at":"2025-11-08T12:30:35.017Z","avatar_url":"https://github.com/fix2015.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Quick Git Bisect Example\n\n## Scenario:\nYou know a bug was introduced somewhere between two commits. One commit is working fine (good), and the other is failing (bad). You need to find the exact commit that introduced the bug.\n\n## Steps:\n\n1. **Start the bisect process**:  \n   First, tell Git which commit is good and which one is bad.\n   ```bash\n   git bisect start\n   git bisect bad HEAD         # Mark the current commit (HEAD) as bad\n   git bisect good \u003cgood_commit_hash\u003e  # Mark a known good commit\n   ```\n\n   For example:\n   ```bash\n   git bisect bad HEAD\n   git bisect good 7907b1b    # The first commit is known to be good\n   ```\n\n2. **Git will check out a commit halfway between the good and bad commits**.  \n   Test the code to see if the bug still exists.\n\n3. **Mark the result**:\n   - If the bug exists, mark the commit as **bad**:\n     ```bash\n     git bisect bad\n     ```\n   - If the bug does **not exist**, mark the commit as **good**:\n     ```bash\n     git bisect good\n     ```\n\n4. **Repeat the process**:  \n   Git will continue narrowing down the range, checking out commits in the middle, until it finds the first bad commit.\n\n5. **Once found**, Git will tell you the exact commit that introduced the bug:\n   ```bash\n   \u003ccommit_hash\u003e is the first bad commit\n   ```\n\n6. **Finish the bisect process**:  \n   After finding the bad commit, run:\n   ```bash\n   git bisect reset\n   ```\n   This returns you to the branch you were on.\n\n---\n\n## Example in Action:\n```bash\n$ git bisect start\n$ git bisect bad HEAD\n$ git bisect good 7907b1b\n# Git checks out a commit halfway between 7907b1b and HEAD\n# Test the code, then mark the commit:\n$ git bisect bad\n# Repeat until Git identifies the bad commit\n$ git bisect reset\n```\n\n## Automated Testing (optional):\nIf you have an automated test to detect the bug, you can run `git bisect` with a test script:\n```bash\ngit bisect run ./test-script.sh\n```\n\nThis will automatically run your script and mark commits as good or bad based on the test result.\n\n---\n\nFor a more in-depth explanation and smarter approaches to bug localization with Git Bisect, check out my full article:  \n[**Debugging with Git Bisect: A Smarter Approach to Bug Localization**](https://medium.com/@vitaliisemianchuk/debugging-with-git-bisect-a-smarter-approach-to-bug-localization-e550da92e19a)\n\n## Connect with Me:\n- [LinkedIn - Vitalii Semianchuk](https://www.linkedin.com/in/vitalii-semianchuk-9812a786/)\n- [Telegram - @jsmentorfree](https://t.me/jsmentorfree) - We do a lot of free teaching on this channel! Join us to learn and grow in web development.\n- [Tiktok - @jsmentoring](https://www.tiktok.com/@jsmentoring) Everyday new videos\n\n## License\n\nMIT License  \nCopyright (c) 2024 Vitalii Semianchuk  \n\n[LinkedIn Profile](https://www.linkedin.com/in/vitalii-semianchuk-9812a786/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffix2015%2Fbisect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffix2015%2Fbisect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffix2015%2Fbisect/lists"}