🔀Diff
Also known as git diff, Difference
A list of the lines that changed from one version of a file to the next.
Think of it like
Think of it like a find the change game. The computer marks each change for you.
Example
Emma runs git diff before she commits. She spots a test line she forgot to remove and deletes it first.
Why it matters
A diff shows what really changed, not what you think changed. It catches slips before they are saved.
Definition
Example code
console
$ git diff
--- a/index.html
+++ b/index.html
@@ -1 +1 @@
-Hello
+Hello, worldCommon mistake
Key takeaways
- 1Minus and plus. Removed lines and added lines.
- 2Any two versions. Compare files, commits or branches.
- 3Read before commit. Catch stray changes early.