git bisect - the saviour

git bisect - the saviour

- 3 mins

Hey! today I am going to talk about one of my favorite git command i.e git bisect.

At present, Git is the most widely used distributed version control system. With the help of git, one can easily collaborate his work easily with others. Read more about git in my another post

So let’s start with the problem:

Let’s say you are working in a large code base with tons of people working on the same project, lots of commits per day. Imagine you went for a week long vacations. After coming back, you find that the product has some issues which was working totally fine when you left. It’s a huge codebase and you aren’t aware of which module is responsible for this wrong behavior. What will you do in that case??

So your next question will be how to use it:

Just remember 3 things:

In the meantime, you can also get the logs of the binary search you are performing with the help of:

git bisect log

And yay! without making many efforts you have found out the commit which caused this behavior. It can also be used to find an issue of the bug or to find the fix of bug.

Read more it at https://git-scm.com/docs/git-bisect

I love fixing the bugs and found git bisect really helpful to find the commit which introduced the bug.

Hoping you will also like it 👍

Thanks

Keep Building & Debugging

Vishwesh Jainkuniya

Vishwesh Jainkuniya

Learner

comments powered by Disqus
rss facebook twitter github youtube mail spotify lastfm instagram linkedin google google-plus pinterest medium vimeo stackoverflow reddit quora quora