How do you find which commit introduced a bug?
IntermediateConceptCommits, branches and tags
Answer
Use git bisect, which binary-searches history. Mark one bad and one good commit, then test each checkout or let a script decide with its exit code (0 good, 1-124 bad, 125 skip).
git bisect start
git bisect bad HEAD
git bisect good v1.3.0
git bisect run ./test.sh
git bisect reset
More on Commits, branches and tags
How do you write a good commit message?BeginnerWhat is the difference between `git add .`, `git add -A` and `git add -u`?BeginnerHow do you commit only part of the changes in a file?BeginnerHow do you change the last commit message or add a forgotten file?BeginnerWhat is the difference between `git switch`, `git restore` and `git checkout`?BeginnerWhat is the difference between lightweight and annotated tags?Beginner