Git Patch and Diff Viewer

Read git format-patch and unified diff files with a file list and line numbers, see word-level changes, and apply or reverse the patch on pasted files.

ブラウザ内で動作します。ファイルは端末の外に出ません。 確認方法を見る

…

使い方

  1. 1
    Open the patch

    Press Open .patch / .diff, paste the text in Patch text, or press Load sample.

  2. 2
    Pick a file

    Click a file in the list to see its changes.

  3. 3
    Choose the view

    Tick Side by side and Syntax colours, or turn colours off to see word changes.

  4. 4
    Provide originals

    In Apply to files press Open original files or paste the current version of each file.

  5. 5
    Apply

    Set fuzz, whitespace and reverse options, then press Apply or Apply to all provided files.

  6. 6
    Download

    Check the hunk results and download each patched file or the ZIP of all of them.

このツールについて

Patches still travel by email, attach to bug trackers and sit in CI artefacts, and reading them as raw text with plus and minus signs is tiring. This viewer opens a .patch or .diff file and shows the commits it contains, the changed files with their status and line counts, and each change in a side-by-side or unified view with line numbers. Syntax colours are applied by file type, or you can switch to word changes to see exactly which words in a line were edited. The Apply tab goes further: paste or open the current version of each file and apply the patch, with offset search and fuzz like GNU patch, or reverse it to undo a change, then download the patched files.

Who this is for

Developers reviewing patches sent by email, maintainers of projects that accept format-patch contributions, support engineers handed a hotfix diff, and anyone who needs to apply a patch without a terminal.

Files it reads

- `git diff` and `git show` output with diff --git headers, index lines, new, deleted and renamed files, mode changes and similarity indexes. - `git format-patch` mail files with From, Date and Subject headers and the commit message, also several commits in one file. - Plain `diff -u` output without git headers. - The "\ No newline at end of file" marker, which is kept when applying.

Reading the changes

The file list shows status (added, deleted, renamed, modified, mode) and added and removed line counts. Side by side pairs removed lines with the added lines that replaced them. Turn Syntax colours off to see word-level highlights: only the changed words inside a modified line are marked.

Applying a patch

Hunks are located by their context lines. If the file has moved on, the tool searches for the context near the expected line and then further away; the offset is reported as in GNU patch. With fuzz 1 or 2, up to that many context lines at the start and end of a hunk may differ. Ignore whitespace helps with re-indented code. Each hunk is reported as applied, applied with offset or fuzz, or failed.

Make a diff

Paste two versions of a text to create a unified diff, then open it in the viewer.

Worked example

The sample patch changes src/client.js and README.md. If two comment lines were added at the top of client.js after the patch was made, Apply still succeeds and reports Hunk 1 at line 3, offset +2, because the context was found two lines lower than the header said.

Limits

Binary patches (GIT binary patch) are listed but not applied. The applier works on files you paste or open; it cannot read your repository or create commits, so use `git apply` or `git am` for that. Three-way merges with conflict markers are not produced.

計算例

Two lines added at the top of client.js since the patch was made: the hunk still applies at line 3 with offset +2.

ポイント

よくある質問

What is the difference between a .patch and a .diff file?

Both contain unified diffs. A .patch from git format-patch also has commit details such as author, date and message, so it can be applied as a commit with git am.

What does offset mean when applying?

The hunk was found a few lines away from the line number in its header, usually because other lines were added or removed earlier in the file.

What is fuzz?

Fuzz allows some context lines at the edges of a hunk to differ. It helps when nearby code changed, but check the result carefully, as a fuzzy match can land in the wrong place.

Can I undo a patch?

Yes. Tick Reverse in the Apply tab and apply it to the patched file to get the original back.

Why does a hunk fail?

The context lines were not found, often because you pasted a different version of the file. Check the version, try more fuzz or Ignore whitespace.

Is my code uploaded?

No. Patches and files are processed only in your browser.

完全無料料金なし、登録なし
ファイルはプライベートすべてブラウザ内で動作します
あなたの言語で使いやすく多くの言語に対応