Diff Viewer
Inline / Split / Whole-File views, hunk staging, image diffs, Markdown preview and stat-dirty cleanup
The diff viewer shows file changes — added, removed and modified lines. It works for uncommitted changes, the staged area, and the contents of any commit.
Three view modes
The mode switch is in the top-right corner of the diff panel.
| Mode | When it's useful |
|---|---|
| Inline | Changes in a single column, one after another. Good for short diffs and narrow screens. |
| Split (side-by-side) | "Before" and "After" in two columns. Good for long rewrites and comparisons. |
| Whole File | The full file with changes highlighted in place, for full context. Very large files fall back to changes-only with a notice. |
There's also an Open in full screen button for reviewing a large diff without the surrounding UI.
How lines are rendered
Syntax is highlighted by file extension, and each hunk shows old and new line numbers in separate columns. The + / − prefixes from git diff are not part of the text — line state is shown by background color only. So copying from the diff never drags those symbols along, and syntax highlighting stays correct. Right-click to Copy line or Copy a selection.
Hunk-level staging
Hover any hunk: a thin frame appears and a floating toolbar slides into its top-right corner.
- Stage — moves only this hunk into the index; the rest of the file stays in the working copy.
- Discard… — reverts this hunk in the working copy after confirmation; other hunks are untouched.
- Unstage — appears in the staged diff and pulls the hunk back out of the index.
No permanent header takes up space per hunk, so longer files show more changes at once. It works the same in Inline and Split, and it's keyboard-accessible — focus a hunk with Tab and the same buttons appear.
Ignore Whitespace
The Ignore Whitespace toggle in the header hides changes that are only whitespace or blank lines — handy when the whole diff is reformatting.
Image diffs
For image files, GitBor compares the two versions visually with Side by Side and Overlay modes (with an opacity slider) instead of showing binary text. Comparing images inside commits requires Git blob extraction, which GitBor handles for you.
Markdown preview
For Markdown files, a Preview Markdown button renders the file so you can read it as it'll appear, not just as raw text.
"No actual changes" (stat-dirty)
Sometimes Git flags a file as modified even though its content matches the committed version — usually line-ending differences (CRLF/LF) or a format-on-save tool touching the file. GitBor detects this and offers Remove from changes, which rewrites the file from the Git version and drops it from the changes list. Real edits are never lost.
Supported diff sources
- Uncommitted changes — what you're editing now.
- Staged changes — what will go into the next commit.
- Commit contents — the diff inside any commit.
- New files — the whole text is shown.
- The repo's first commit — rendered correctly without a parent.
File and folder actions
The Local Changes tree has a context menu:
- File: Stage / Unstage / Discard, plus Blame and File History (see Blame & History).
- Folder: Stage all / Unstage all / Discard all / Delete untracked — applies to every file inside, in both the staged and unstaged sections.
Auto-close after commit
When a file leaves the changes list (for example, it went into a commit), its diff panel closes automatically — no stale diffs left hanging around.