The DiffViewer displays changes between files, showing what was added, removed, or modified. It’s shown when you select a file in the Unstaged or Staged files list.
The DiffViewer shows:
| Content Type | Description |
|---|---|
| Text files | Syntax-highlighted diff with line-by-line or side-by-side view |
| Image files | Visual comparison with side-by-side, swipe, or difference modes |
| Binary files | Notification that diff isn’t available |
You can switch between diff view modes:
💡 Change the default view mode in View → Diff View Mode
| Symbol | Meaning |
|---|---|
| Red line | Content was removed |
| Green line | Content was added |
| Line numbers | Show where changes occur in the file |
Changes are grouped into “chunks” — contiguous sections of changes. Each hunk shows:
@@ -10,5 +10,7 @@)When you select an image file (PNG, JPG, GIF, SVG, etc.), ugit provides three comparison modes.
Shows the original and modified images next to each other.

A single view with a draggable divider:

Shows a computed difference image:

This helps identify exactly what changed in an image.
When you hover over a diff chunk, action buttons appear:

| Action | Description |
|---|---|
| Stage | Stage only this chunk |
| Discard | Discard changes in this chunk |
⚠️ Warning: Discarding changes cannot be undone.
When viewing a conflicted file during a merge, the DiffViewer shows conflict markers:
<<<<<<< HEAD
Your changes
=======
Incoming changes
>>>>>>> branch-name
Use the conflict resolution controls to choose which version to keep:

| Action | Shortcut |
|---|---|
| Refresh diff | F5 |
Always review your changes in the DiffViewer before staging and committing. This ensures you’re including exactly what you intend.
For images, use the Difference mode to spot subtle changes that might be hard to see otherwise.
For large files, you can stage or discard individual chunks rather than the entire file.
This can happen when:
If you expect to see changes but don’t: