Git · Senior · Question 23 of 76

Why should every commit on main build and pass tests, not just the PR's final state?

Explanation

If intermediate commits are broken, git bisect lands on failures unrelated to the bug. Squash merges or a "every commit is green" policy avoid that.

Further reading

Problem with a question

Git · Senior · question 23

Test yourself

Take the Git · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz