1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-23 01:22:08 +02:00
tldr/pages/common/git-bisect.md
Muhammad Falak R Wani 9661c8dc7c
git-bisect: add log example (#8460)
Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>

Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
2022-09-07 15:03:20 +00:00

25 lines
849 B
Markdown

# git bisect
> Use binary search to find the commit that introduced a bug.
> Git automatically jumps back and forth in the commit graph to progressively narrow down the faulty commit.
> More information: <https://git-scm.com/docs/git-bisect>.
- Start a bisect session on a commit range bounded by a known buggy commit, and a known clean (typically older) one:
`git bisect start {{bad_commit}} {{good_commit}}`
- For each commit that `git bisect` selects, mark it as "bad" or "good" after testing it for the issue:
`git bisect {{good|bad}}`
- After `git bisect` pinpoints the faulty commit, end the bisect session and return to the previous branch:
`git bisect reset`
- Skip a commit during a bisect (e.g. one that fails the tests due to a different issue):
`git bisect skip`
- Display a log of what has been done so far:
`git bisect log`