DiffEdit is a native macOS text editor built around one idea: source changes are easier to understand when the code you are writing and the code you started from stay visible together.
Open a folder inside a Git repository and DiffEdit compares every edited file
with HEAD as you type. It highlights line- and word-level changes, keeps the
relevant committed context above the editor, and lets you review, stage, and
commit selected lines without leaving the app.
DiffEdit is currently an early-stage project for macOS 13 and newer.
- Git-aware editing — additions, edits, and deletions are highlighted
against the version in
HEAD, with line numbers, deletion markers, and a document overview showing where changes are located. - Committed context at the caret — a resizable pane follows the current editing position and shows the corresponding committed lines, making small changes easy to understand without switching to a separate diff view.
- Focused change navigation — jump between changed blocks and continue across changed files from the keyboard.
- Selective staging — review a compact unified diff, include or exclude individual added and deleted lines, and stage directly from the in-memory editor buffer. A file does not need to be saved before it is staged.
- Built-in commits — write a summary and optional description, then commit the selected changes to the current branch from within DiffEdit.
- Multi-file buffers — move between files without losing edits. DiffEdit marks unsaved buffers and offers to save them together when a window closes.
- Safe external-change handling — if another process changes or deletes an open file, DiffEdit asks whether to keep the buffer, reload from disk, or cancel before overwriting anything.
- Quick file access — browse the repository tree, filter files with Quick Open, reopen recent folders, and work in multiple folder windows.
- Native macOS experience — an AppKit interface with standard menus, keyboard shortcuts, adjustable type size, and optional word wrapping.
- Open a folder within a Git repository.
- Select a file from the sidebar or press ⌘T to use Quick Open.
- Edit while the committed-context pane and inline highlights track the
difference from
HEAD. - Switch from Edit to Stage & Commit.
- Choose the lines to include, stage them, and create the commit.
DiffEdit also works when the opened folder is below the repository root. To avoid committing changes you cannot see, it blocks commits if the Git index contains staged files outside the opened folder.
| Action | Shortcut |
|---|---|
| Quick Open | ⌘T |
| Save current file | ⌘S |
| Previous / next change | ⇧⌘, / ⇧⌘. |
| Previous / next paragraph | ⌥↑ / ⌥↓ |
| Toggle word wrapping | ⌥⌘W |
| Increase / decrease type size | ⌘+ / ⌘− |
Requirements:
- macOS 13 or newer
- Xcode 15 or newer
Open DiffEdit.xcodeproj, select the shared DiffEdit scheme, and press
⌘R.
The checked-in Xcode project is generated from project.yml. After changing
the project structure, regenerate it with XcodeGen:
xcodegen generateBuild a runnable app bundle with:
./Scripts/build_app.shThe resulting app is written to build/DiffEdit.app.
Run the test suite with:
DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer xcrun swift testDiffEdit has no third-party runtime dependencies. The app is written in Swift and AppKit, with the main code organized around:
EditorViewController.swiftandEditorViews.swift— editing, committed context, navigation, and diff presentationDiffEngine.swift— line and word diffs plus selective-staging plansRepository.swift— repository discovery, status, staging, and commitsSidebar.swiftandQuickOpen.swift— folder navigation and file accessStagingDiffView.swift— unified-diff review and per-line selection
DiffEdit is available under the MIT License.