When you create a Pull Request on GitHub, you can view the changes in two different formats: patch and diff.
By appending .patch or .diff to the end of a Pull Request URL, GitHub displays the changes in a plain text format generated by Git.
Many of you have probably seen this kind of view before.
ProTip! Add .patch or .diff to the end of URLs for Git’s plaintext views.

Below, we will look at the differences between these two formats using an actual Pull Request I created as an example.
Patch Format
In the patch format, when a Pull Request includes binary files such as images, the output contains their contents as well.
From 7908e88a1715448e01213d1d846e3c3ec6bd12c4 Mon Sep 17 00:00:00 2001
From: lef237 <[email protected]>
Date: Mon, 5 Jan 2026 19:06:21 +0900
Subject: [PATCH 1/7] Add heart texture
---
art/heart.png | Bin 0 -> 62817 bytes
art/heart.png.import | 34 ++++++++++++++++++++++++++++++++++
2 files changed, 34 insertions(+)
create mode 100644 art/heart.png
create mode 100644 art/heart.png.import
diff --git a/art/heart.png b/art/heart.png
new file mode 100644
index 0000000000000000000000000000000000000000..334225e28bb507b5ccb22f0168050f4cb0d5c29d
GIT binary patch
literal 62817
zcmbrkb9g4*wl5l|W81cEt2?%B+sPYsY?~e1cw=_#q+{E5a{F6rpS{<;=bpdLtfyv;
z8sj%G$E@e6IcipfqP!FWEG{ev2nd3Vw7Bx$>(}3N{TtNZzK7Z49|nYlh@1!rNPQgK
(omission)
r=3fQuQkxHE|MBJI|6PqCA4~>03z)$si32r2d=5D&WyvaWlc4_rU}pLT
literal 0
HcmV?d00001
diff --git a/art/heart.png.import b/art/heart.png.import
new file mode 100644
index 0000000..2bf152c
--- /dev/null
+++ b/art/heart.png.import
@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://c78koksxx6my5"
+path="res://.godot/imported/heart.png-d360d4cc98667652a308f99b846b988b.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
Specifically, binary files are encoded using Git’s binary patch format and included directly in the patch. This means that the patch file itself contains all the information necessary to recreate the binary files when applied.
As a result, patch files can become quite large, especially when they include images or other binary assets.
Diff Format
In contrast, the diff format does not include the actual contents of binary files.
diff --git a/art/heart.png b/art/heart.png
new file mode 100644
index 0000000..334225e
Binary files /dev/null and b/art/heart.png differ
diff --git a/art/heart.png.import b/art/heart.png.import
new file mode 100644
index 0000000..2bf152c
--- /dev/null
+++ b/art/heart.png.import
@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://c78koksxx6my5"
+path="res://.godot/imported/heart.png-d360d4cc98667652a308f99b846b988b.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
Instead, for binary changes, it simply displays a message indicating that the binary files differ (for example, “Binary files differ”). Text-based files are still shown as normal diffs, but the binary data itself is omitted.
This keeps the diff output smaller and easier to read when you are mainly interested in code or text changes.
Summary
To summarize, the main differences between the patch and diff formats provided by GitHub Pull Requests are as follows:
-
Patch format: Includes the contents of binary files, encoded using Git’s binary patch format.
-
Diff format: Does not include binary file contents and instead shows a message indicating that the binary files differ.
Including binary data can be useful when you want to apply a patch that fully reproduces all changes, including assets. However, it can significantly increase the size of the patch. If you only want to review or apply source code changes, the diff format is generally the better choice.1
Footnotes
-
In other words, this difference can also be described as the distinction between a format equivalent to
git format-patchand one equivalent togit diff. ↩