Mid
From PDF
Version Control
Git & GitHub
How can you view the difference between two commits?
Short answer: Use git diff with two commit hashes: git diff <commit1> <commit2> This shows line-by-line changes between the two commits. Example: If you want to compare how your project changed between version 1.0 and version 1.1: git diff v1.0 v1.1 You’ll see added, removed, and modified lines across files.
Real-world example (ShopNest)
Prefer clear commits: fix(cart): prevent negative quantities instead of update.
Say this in the interview
- Define — one clear sentence (the short answer above).
- Example — relate it to a project like ShopNest or your real work.
- Trade-off — when you would not use it.
Share this Q&A
Share preview image: https://www.toolliyo.com/images/toolliyo-logo.png