diff
Also called: diffs
A view of what changed between two versions: removed lines in red with a minus, added lines in green with a plus.
A diff answers "what exactly changed?". It compares two versions line by line: lines that were removed are shown in red with a minus, lines that were added in green with a plus, and a few unchanged lines around them give context. A changed line appears as one removal and one addition. GitHub shows a diff on every commit page and in a pull request's Files changed tab; a split view puts the old and new versions side by side.
Example
The diff of Daniel's commit a41c09e shows one red line, "delivery": 49, and one green line, "delivery": 59, in config/prices.json.
Common mistakes
Reading only the lines of the diff and missing what is not there: a change to the price without the matching change to the FAQ text is a gap you only notice by thinking about what else should have changed.
Learn it in the course
- Reading history: messages, diffs and blame · How to open a file's history, read a diff line by line and use blame to trace any line back to its commit, pull request and issue.
- Reviewing as a PM: comments, suggestions, approve · What a product person checks in a pull request and what to leave to engineers, how to comment on a line, suggest exact wording, choose between Comment, Approve and Request changes, and write review comments people are glad to get.
- Repository and commits: reading a repo page · A GitHub repository page from top to bottom, what a single commit page tells you, and what makes a good commit message.
- Anatomy of a pull request: tabs, description, checks · Read a pull request page top to bottom: base and compare branches, draft and ready, the four tabs, the description, reviewers and labels, linked issues, checks and the merge box.
- Your first change in the browser, and how to undo it · Make a small change entirely in the GitHub web UI: find the file, edit it, commit to a new branch because main is protected, open a pull request, pass checks and review, merge and deploy. Then undo a merged change with the Revert button, learn when to revert and when to fix forward, and what a PM should and shouldn't edit.