Git Patch Viewer

Read Git patches and unified diffs. Paste git diff output or open a .patch or .diff file to browse changed files, additions, deletions, and line numbers.

Patch source

How to view a Git patch

Paste the output of git diff --no-color or git show --format=, or select Open file to read a local .patch or .diff file. Select View patch, then choose a file to see its changes. Use sample shows how a patch can contain both text changes and file-only changes. The viewer reads the patch in your browser.

Read a unified diff

A unified diff groups nearby changes into hunks. A header like @@ -4,3 +4,4 @@ describes the starting line and span before and after the change. Lines beginning with - were removed, lines beginning with + were added, and a leading space marks context that appears in both versions. The old and new columns give each line’s position in the two versions. A missing-newline marker refers to the line immediately above it.

Recognize renames, permissions, and binary changes

A Git patch can record a rename, copy, or file mode change without changing any text lines. For example, changing the mode from 100644 to 100755 makes a regular file executable. The viewer identifies binary changes so they can be found in the file list. It also reads standard text attachments produced by git format-patch.

View changes in a merge commit

Combined merge diffs use multiple old-line columns in the same hunk. To view separate unified patches against each parent, run git show -m --format= HEAD for the current merge commit. The viewer displays changes from a patch. To compare two complete text versions, use the site’s Text Diff tool. Git patch format