Git Diff: A Complete Comparison Tutorial for Git

Being able to make comparisons in your project is extremely useful: It might help you track down how a bug was introduced. For inspiration, this is what my file looks like after the changes: Now, run git diff without any arguments and you’ll get a result like the following: Let’s now walk you through that […]

Being able to make comparisons in your project is extremely useful: It might help you track down how a bug was introduced. For inspiration, this is what my file looks like after the changes: Now, run git diff without any arguments and you’ll get a result like the following: Let’s now walk you through that output line by line: The output starts by declaring this is a diff in the Git format, comparing these two files. And the good news is that, while there are plenty of Git commands with even more plentiful options, you only need to master a relatively small set of core commands to be fluent with the tool.
Source: CloudBees