What is a Diff?
A diff (difference) shows changes between two versions of text or code. Lines highlighted in green indicate additions, red shows deletions, and unchanged lines appear in gray. This visual representation makes it easy to track what changed between versions.
Common Use Cases
- Code Reviews: Compare code changes before merging
- Document Editing: Track revisions in contracts or articles
- Configuration Files: Spot differences in settings between environments
- Version Control: Understand what changed between commits
- Debugging: Compare working vs. broken code to find issues
Reading Diff Output
Green lines (additions): Text that appears in the modified version but not in the original.
Red lines (deletions): Text that was in the original but removed in the modified version.
Gray lines (unchanged): Text that remains the same in both versions.