level 3Git & Version Control
Diff
also: diffs, git diff
A view showing exactly what changed between two versions of your files: which lines were added, removed, or edited.
a bit more technical
A line-by-line comparison between two states of files, such as the working tree and the last commit, two commits, or two branches. Added lines are usually marked with + (often green) and removed lines with - (often red).
picture it
Track changes in a Word document. You don't reread the whole essay. You see just the crossed-out and inserted bits.
why it matters
The diff is how you review an agent's work without reading the whole codebase. It shows everything that changed, including things the agent didn't mention.
what your agent might say
Here's the diff: 3 files changed, 24 insertions, 9 deletions. The main change is in invoice.ts; the other two are test updates.
how you might use it
Show me the diff before you commit. Point out any change outside the files we discussed.
common mistake
Trusting the agent's summary instead of the diff. Summaries can leave things out. The diff can't.
builds on