git-merge-workshops / git-it-right

In this workshop, participants will learn the basics of common Git commands used in various situations. This includes commands which help you examine repo history and state while also learning to manipulate repo history.
5 stars 0 forks source link

Fun git bisect #5

Open bryantson opened 2 years ago

bryantson commented 2 years ago

Let's learn fun git bisect

image

Git bisect is an useful built-in tool within git cli that you lets you search a specific commit through binary search. Following shows some situations when git bisect is handy:

How can you get started with git bisect?

  1. You start with git bisect start to activate git bisect. Now, fun begins!
  2. Run git bisect bad <SHA ID> where you expect somewhere after a change got introduced
  3. Run git bisect good <SHA ID> where you expect somewhere before a change got introduced. This SHA ID has to happen before a git bisect bad. Now, it will start binary search process by splitting a mid point between bad and good
  4. If you did not find a result, you enter git bisect bad. This will split in half again and search.
  5. If you found a result, enter git bisect good
  6. Lastly, type git bisect reset to terminate git bisect
bryantson commented 2 years ago

Congratulation. You are done with "Fun Git Bisect" section

mona

Let's move to the next issue