Git Cheatsheet - Quick Git Command Reference

Quick reference for common Git commands. Search, copy, and use Git commands instantly.

Share
Back to Git Cheatsheet

git bisect

Binary search to find bug-introducing commit

Syntax

git bisect <subcommand>

Common Options

OptionDescription
startStart bisect session
bad [<rev>]Mark current or specified commit as bad
good [<rev>]Mark current or specified commit as good
resetEnd bisect session
run <cmd>Run automated test script
skipSkip current commit
visualizeVisualize with gitk
replay <file>Replay bisect log

Examples

git bisect start

Start bisect

git bisect bad

Mark current as bad

git bisect good v1.0

Mark v1.0 as good

git bisect run npm test

Auto-run tests to find issue

git bisect reset

End bisect and restore HEAD

Related Tools

More Code & Dev Tools