DEV Community

Discussion on: What is your favourite Git command?

Collapse
 
rohitshetty profile image
Rohit Shetty
git bisect

Git bisect saved my ass a few times last few weeks. Git bisect helps you find out when a previously unnoticed anomaly was introduced. You mark your current version as bad and some previous commit as good (where you know that anomaly didn't exist) and then Git bisect continues "bisecting" your commit history, you continue to mark the current version as either good or bad, ultimately identifying the commit where this unnoticed then bug was introduced.

This can also be used to identify commit when a certain feature was added too. In short, I find it useful especially working with a codebase that does not have much test coverage.