Realm by Rook
AI product engineeringProduct designAI implementationWorkflow automationSystems integrationDomain strategyAI product engineeringProduct designAI implementationWorkflow automationSystems integrationDomain strategy
Developer & Technical Tools

Diff Patch Applier

Apply unified diffs or copy-patch output to an original document

The quick brown fox
leaps over the sleepy cat.
Line 3.
Supported patch formats
  • Realm Text Diff Checker format: context, + added, − removed
  • Unified diff (git / diff -u): context, +added, -removed. @@ hunk headers and ---/+++ file headers are ignored — all hunks apply top-to-bottom on the provided original.

How to use

  1. Paste the original text on the left
  2. Paste the patch on the right
  3. Review the patched output and any conflicts
  4. Copy the final result

Use cases

  • Applying code-review patches
  • Rebuilding files from diffs
  • Pre-testing git apply
  • Manual merges

About the Diff Patch Applier

A patch is a tiny description of the changes between two versions of a file. Applying one reconstructs the 'after' version from the 'before' version plus the diff. It's how git, code review tools, and operating system package managers ship updates. This tool applies patches in the browser with conflict visibility — useful for testing a patch before git-apply, or just understanding what a patch does.

Features

  • Accepts git / POSIX unified-diff format (+ -, space context, @@ headers)
  • Accepts our Text Diff Checker 'Copy Patch' format (+ −, two-space context)
  • Live result updates as you edit either side
  • Conflict detection with line-number reporting
  • Handles multiple hunks in a single patch

How it works

  1. Paste the original text on the left.
  2. Paste the patch (unified diff or our Copy Patch format) on the right.
  3. The patched result appears below; conflicts (if any) are listed with line numbers.
  4. Copy the result.

Frequently asked questions

Does this replace git apply?

+

No — use git apply for production patches with binary files, renames, etc. This is for the 90% case: a single text file + a patch, done in the browser without a terminal.

What are 'conflicts'?

+

When the patch expects context line X but your original has Y at that position, the patch still applies but the mismatch is flagged so you can review. Matches git apply --reject behavior.

Does it handle binary files?

+

No — this is text-only. Binary patching requires git.

Do hunk headers (@@) matter?

+

They're ignored — we apply hunks sequentially to the provided original. For correct behavior, either supply a single-hunk patch or make sure the original starts at the first hunk's context.

Can I reverse a patch (unapply)?

+

Swap the + and − prefixes in your patch text before applying. True reverse-apply is on the roadmap.