Software bugs have been a problem for as long as software has existed. As Git records all the commits to the repository then it becomes a great source of information and diagnostic tool when identifying how issues were introduced.
In this scenario we'll explore the different ways you can find which commit introduced the problem. The environment has been initialised with a Git repository containing a single HTML file which renders a list of items.
With the comprehensive history of your source code within the Git repository allows you to go back in time and identify when issues occurred, such as bugs or performance issues.
git diff allow you to quickly compare changes, while
git bisect helps you search to identify the cause.
This scenario has been added to your scrapbook where you can review the examples and commands you executed.
Scenario 7 - Finding Bugs
Git Diff Two Commits
git diff command is the simplest to compare what's changed between commits. It will output the differences between the two commits.
You can visually any two commits by providing the two commits hash-ids or pointers (blobs)
git diff HEAD~2 HEAD