{
    "archive_path": "archive/1791713075.907406",
    "base_url": "ratfactor.com/cards/git-commit-size",
    "basename": "git-commit-size",
    "bookmarked_date": "2026-10-11 10:04",
    "canonical": {
        "archive_org_path": "https://web.archive.org/web/ratfactor.com/cards/git-commit-size",
        "dom_path": "output.html",
        "favicon_path": "favicon.ico",
        "git_path": "git/",
        "google_favicon_path": "https://www.google.com/s2/favicons?domain=ratfactor.com",
        "headers_path": "headers.json",
        "htmltotext_path": "htmltotext.txt",
        "index_path": "index.html",
        "media_path": "media/",
        "mercury_path": "mercury/content.html",
        "pdf_path": "output.pdf",
        "readability_path": "readability/content.html",
        "screenshot_path": "screenshot.png",
        "singlefile_path": "singlefile.html",
        "warc_path": "warc/",
        "wget_path": "ratfactor.com/cards/git-commit-size.html"
    },
    "domain": "ratfactor.com",
    "extension": "",
    "hash": "DWHN9NVPE658T5QD51CB",
    "history": {
        "archive_org": [],
        "dom": [],
        "favicon": [
            {
                "cmd": [
                    "curl",
                    "--silent",
                    "--location",
                    "--compressed",
                    "--max-time",
                    "120",
                    "--output",
                    "favicon.ico",
                    "--user-agent",
                    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 ArchiveBox/0.7.4 (+https://github.com/ArchiveBox/ArchiveBox/) curl/curl 8.14.1 (x86_64-pc-linux-gnu)",
                    "https://www.google.com/s2/favicons?domain=ratfactor.com"
                ],
                "cmd_version": "curl 8.14.1 (x86_64-pc-linux-gnu)",
                "end_ts": "2026-10-11T16:29:18.196073+00:00",
                "index_texts": null,
                "output": "favicon.ico",
                "pwd": "/data/archive/1791713075.907406",
                "schema": "ArchiveResult",
                "start_ts": "2026-10-11T16:29:17.611733+00:00",
                "status": "succeeded"
            },
            {
                "cmd": [
                    "curl",
                    "--silent",
                    "--location",
                    "--compressed",
                    "--max-time",
                    "120",
                    "--output",
                    "favicon.ico",
                    "--user-agent",
                    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 ArchiveBox/0.7.4 (+https://github.com/ArchiveBox/ArchiveBox/) curl/curl 8.14.1 (x86_64-pc-linux-gnu)",
                    "https://www.google.com/s2/favicons?domain=ratfactor.com"
                ],
                "cmd_version": "curl 8.14.1 (x86_64-pc-linux-gnu)",
                "end_ts": "2026-10-11T10:05:27.249267+00:00",
                "index_texts": null,
                "output": "favicon.ico",
                "pwd": "/data/archive/1791713075.907406",
                "schema": "ArchiveResult",
                "start_ts": "2026-10-11T10:05:26.638242+00:00",
                "status": "succeeded"
            },
            {
                "cmd": [
                    "curl",
                    "--silent",
                    "--location",
                    "--compressed",
                    "--max-time",
                    "120",
                    "--output",
                    "favicon.ico",
                    "--user-agent",
                    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 ArchiveBox/0.7.4 (+https://github.com/ArchiveBox/ArchiveBox/) curl/curl 8.14.1 (x86_64-pc-linux-gnu)",
                    "https://www.google.com/s2/favicons?domain=ratfactor.com"
                ],
                "cmd_version": "curl 8.14.1 (x86_64-pc-linux-gnu)",
                "end_ts": "2026-10-11T19:27:02.896129+00:00",
                "index_texts": null,
                "output": "favicon.ico",
                "pwd": "/data/archive/1791713075.907406",
                "schema": "ArchiveResult",
                "start_ts": "2026-10-11T19:27:02.193710+00:00",
                "status": "succeeded"
            }
        ],
        "git": [],
        "headers": [
            {
                "cmd": [
                    "curl",
                    "--silent",
                    "--location",
                    "--compressed",
                    "--head",
                    "--max-time",
                    "120",
                    "--user-agent",
                    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 ArchiveBox/0.7.4 (+https://github.com/ArchiveBox/ArchiveBox/) curl/curl 8.14.1 (x86_64-pc-linux-gnu)",
                    "https://ratfactor.com/cards/git-commit-size"
                ],
                "cmd_version": "curl 8.14.1 (x86_64-pc-linux-gnu)",
                "end_ts": "2026-10-11T16:29:19.195219+00:00",
                "index_texts": null,
                "output": "headers.json",
                "pwd": "/data/archive/1791713075.907406",
                "schema": "ArchiveResult",
                "start_ts": "2026-10-11T16:29:18.202458+00:00",
                "status": "succeeded"
            },
            {
                "cmd": [
                    "curl",
                    "--silent",
                    "--location",
                    "--compressed",
                    "--head",
                    "--max-time",
                    "120",
                    "--user-agent",
                    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 ArchiveBox/0.7.4 (+https://github.com/ArchiveBox/ArchiveBox/) curl/curl 8.14.1 (x86_64-pc-linux-gnu)",
                    "https://ratfactor.com/cards/git-commit-size"
                ],
                "cmd_version": "curl 8.14.1 (x86_64-pc-linux-gnu)",
                "end_ts": "2026-10-11T10:05:28.145958+00:00",
                "index_texts": null,
                "output": "headers.json",
                "pwd": "/data/archive/1791713075.907406",
                "schema": "ArchiveResult",
                "start_ts": "2026-10-11T10:05:27.258394+00:00",
                "status": "succeeded"
            },
            {
                "cmd": [
                    "curl",
                    "--silent",
                    "--location",
                    "--compressed",
                    "--head",
                    "--max-time",
                    "120",
                    "--user-agent",
                    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 ArchiveBox/0.7.4 (+https://github.com/ArchiveBox/ArchiveBox/) curl/curl 8.14.1 (x86_64-pc-linux-gnu)",
                    "https://ratfactor.com/cards/git-commit-size"
                ],
                "cmd_version": "curl 8.14.1 (x86_64-pc-linux-gnu)",
                "end_ts": "2026-10-11T19:27:04.142824+00:00",
                "index_texts": null,
                "output": "headers.json",
                "pwd": "/data/archive/1791713075.907406",
                "schema": "ArchiveResult",
                "start_ts": "2026-10-11T19:27:02.900581+00:00",
                "status": "succeeded"
            }
        ],
        "htmltotext": [],
        "media": [],
        "mercury": [
            {
                "cmd": [
                    "/app/node_modules/@postlight/parser/cli.js",
                    "https://ratfactor.com/cards/git-commit-size"
                ],
                "cmd_version": "1.0.0",
                "end_ts": "2026-10-11T16:29:28.397715+00:00",
                "index_texts": null,
                "output": "mercury",
                "pwd": "/data/archive/1791713075.907406",
                "schema": "ArchiveResult",
                "start_ts": "2026-10-11T16:29:23.368065+00:00",
                "status": "succeeded"
            },
            {
                "cmd": [
                    "/app/node_modules/@postlight/parser/cli.js",
                    "https://ratfactor.com/cards/git-commit-size"
                ],
                "cmd_version": "1.0.0",
                "end_ts": "2026-10-11T10:05:37.501612+00:00",
                "index_texts": null,
                "output": "mercury",
                "pwd": "/data/archive/1791713075.907406",
                "schema": "ArchiveResult",
                "start_ts": "2026-10-11T10:05:32.571289+00:00",
                "status": "succeeded"
            },
            {
                "cmd": [
                    "/app/node_modules/@postlight/parser/cli.js",
                    "https://ratfactor.com/cards/git-commit-size"
                ],
                "cmd_version": "1.0.0",
                "end_ts": "2026-10-11T19:27:12.394947+00:00",
                "index_texts": null,
                "output": "mercury",
                "pwd": "/data/archive/1791713075.907406",
                "schema": "ArchiveResult",
                "start_ts": "2026-10-11T19:27:08.272808+00:00",
                "status": "succeeded"
            }
        ],
        "pdf": [],
        "readability": [
            {
                "cmd": [
                    "/app/node_modules/readability-extractor/readability-extractor",
                    "/tmp/tmpmhl0kna6",
                    "https://ratfactor.com/cards/git-commit-size"
                ],
                "cmd_version": "0.0.11",
                "end_ts": "2026-10-11T16:29:23.355948+00:00",
                "index_texts": [
                    "Page created: 2026-01-10\n            \n            \n            \n            \n                Updated: 2026-07-24\n                \n            \n        \n\n        \n        \nShort answer: It depends. Git stores \"objects\" as zlib compressed data. So the exact size of a commit will depend on the compressibility of your files (which is basically a function of the amount of repetition in them).\n\nThe other factor is that Git eventually turns object files into even more efficient packfiles, saving additional space by getting rid of redundancy across objects.\n\nFor fun, I did some little experiments (all \"loose objects\" with no packfiles created). Here\u2019s the results:\n\n\n\n64,828 bytes - git init\n\n\n47,640 bytes - committing 250 tiny files\n\n\n17,145 bytes - committing 3 bytes of change to a file in a directory of 50 files\n\n\n8,709 bytes - committing 3 bytes of change to a single-file repo\n\n\n297,873 bytes - committing a 583,840 byte binary file\n\n\n1,622,188 bytes - committing a huge 16,415,223 byte source file\n\n\n\nSo we see kilobytes of overhead for very tiny commits - exactly how much will depend on the size of the file/directory tree involved with the changes.\nFor larger commits with small numbers of files, the stored data in .git will be anywhere from 50% to 10% of the uncompressed committed files.\nIn other words, it\u2019s extremely efficient.\nBelow is the running log of the experiments resulting in the numbers above.\n\nInit, 5 directories, 250 files\n\nFirst, how big is a brand new empty Git directory (.git)?\n\n$ git init\nInitialized empty Git repository in /home/dave/tmp/foo/.git/\n\n$ du -sb .git\n64828\t.git\n\nAbout 64 Kb.\n(The du options are: s to summarize and b to display bytes.)\nNow I\u2019m going to make a bunch of tiny files in directories with a pair of nested shell loops:\n\n$ for d in {1..5};do\n    mkdir $d;\n    for f in {1..50};do\n        echo foo > $d/$f;\n    done;\ndone\n\nNow I have 250 files in 5 directories containing the string \"foo\":\n\n$ ls\n1  2  3  4  5\n$ cat 2/45\nfoo\n\nI\u2019ll commit them:\n\n$ git add .\n$ git commit -m 'initial commit'\n\nLet\u2019s see how big .git is now:\n\nThe commit has added about 47 Kb to the initial blank repo.\nAside: I calculated this in the geekiest way I could think of, using the standard Unix command dc, the arbitrary precicision reverse-polish notation desk calculator (note that 'p' is the print command so we can see the result!):\n\n$ dc -e '112468 64828 - p'\n47640\n\nNow I\u2019ll make one tiny change to one file and commit it:\n\n$ echo bar > 1/1\n$ git commit -am 'changed 1/1'\n\n$ du -sb .git\n129613\n$ dc -e '129613 112468 - p'\n17145\n\nSo that\u2019s 17 Kb to store about 3 bytes of changes to my repo.\nWhere is that weight coming from?\nI\u2019m gonna do another little commit. Here\u2019s what it looks like before:\n\n$ du -b .git\n4096\t.git/objects/info\n4096\t.git/objects/pack\n4115\t.git/objects/25\n4155\t.git/objects/7b\n4225\t.git/objects/af\n4115\t.git/objects/57\n4271\t.git/objects/07\n4177\t.git/objects/61\n4255\t.git/objects/bb\n4299\t.git/objects/a8\n45900\t.git/objects\n4336\t.git/info\n4096\t.git/refs/tags\n4137\t.git/refs/heads\n12329\t.git/refs\n4096\t.git/branches\n4411\t.git/logs/refs/heads\n8507\t.git/logs/refs\n12918\t.git/logs\n27538\t.git/hooks\n129613\t.git\n\nThen I modify file 1/1 again to contain the string 'baz' and commit that.\nAfter:\n\n4096\t.git/objects/info\n4096\t.git/objects/pack\n4115\t.git/objects/25\n4253\t.git/objects/81 <-- new 4 Kb\n4155\t.git/objects/7b\n4225\t.git/objects/af\n4115\t.git/objects/57\n4271\t.git/objects/07\n4177\t.git/objects/61\n4302\t.git/objects/fc <-- new 4 Kb\n4255\t.git/objects/bb\n4115\t.git/objects/76 <-- new 4 Kb\n4299\t.git/objects/a8\n4177\t.git/objects/92 <-- new 4 Kb\n62747\t.git/objects\n4336\t.git/info\n4096\t.git/refs/tags\n4137\t.git/refs/heads\n12329\t.git/refs\n4096\t.git/branches\n4561\t.git/logs/refs/heads <-- added 0.1 Kb\n8657\t.git/logs/refs\n13218\t.git/logs\n27538\t.git/hooks\n146759\t.git\n\nThat\u2019s 4 new objects for a single-file commit.\nThanks to Julia \"b0rk\" Evans\u2019s awesome work on the\nnew Git data model documentation (jvns.ca)\n, I can figure out what these new objects are.\nAlthough these files are all zlib compressed data, I figured out that git show will show the value of any object by hash identifier, not just commits!\nSo to view these objects, I did:\n\n$ ls .git/objects/81\nb1a9d27494b40679d612b96bb6acaac83afa9c\n$ git show 81b1a9d27494b40679d612b96bb6acaac83afa9c\n\nAnd the results are:\n\n\n\n81\u2026\u200b is my actual commit\n\n\nfc\u2026\u200b is the tree file for the changed directory 1., listing all of the files in that directory (1 through 50).\n\n\n76\u2026\u200b is the actual contents of file 1/1 (which is now the string 'baz')\n\n\n92\u2026\u200b is another tree for the root directory of the repo\n\n\n\nThat makes sense. There\u2019s a commit, two trees, and one file.\n\n\n\nTiny repo\n\nHow about a repo with just a single little file. How much space does a commit require then?\n\n$ git init\n$ echo foo > foo\n$ git add foo\n$ git commit -m 'initial'\n$ du -sb .git\n94208\n$ echo bar > foo\n$ git -am 'change1'\n$ du -sb .git\n102917\n$ dc -e '102917 94208 - p'\n8709\n\nSo that\u2019s 8 Kb per commit, about half the size of the repo with a larger tree of files. I suspect a lot of the size of both of these is overhead and larger commits will see substantial savings.\n\n\n\n\"Big\" files?\n\nLet\u2019s add a \"big\" (580 Kb) binary file:\n\n$ cp /usr/bin/librewolf .\n$ du -b librewolf\n583840\n$ git add .\n$ git commit -m 'added librewolf'\n$ du -sb .git\n400790\n$ dc -e '400790 102917 -  p'\n297873\n\nThe binary compresses quite a bit, so the commit is smaller than the added file (300 Kb for a 580 Kb file).\nEven better, a huge (16.2 Mb) text source file:\n\n$ cp /usr/src/linux...mask.h .\n$ du -b nbio_7_2_0_sh_mask.h\n16415223\n$ git add .\n$ git commit -m 'huge source'\n$ du -sb .git\n2022978\n$ dc -e '2022978 400790 - p'\n1622188\n\nSo that\u2019s 1.6 Mb to commit a 16.4 Mb source file! I expected the text to compress nicely, but that\u2019s really impressive."
                ],
                "output": "readability",
                "pwd": "/data/archive/1791713075.907406",
                "schema": "ArchiveResult",
                "start_ts": "2026-10-11T16:29:21.360118+00:00",
                "status": "succeeded"
            },
            {
                "cmd": [
                    "/app/node_modules/readability-extractor/readability-extractor",
                    "/tmp/tmp_g73e3f6",
                    "https://ratfactor.com/cards/git-commit-size"
                ],
                "cmd_version": "0.0.11",
                "end_ts": "2026-10-11T10:05:32.561139+00:00",
                "index_texts": [
                    "Page created: 2026-01-10\n            \n            \n            \n            \n                Updated: 2026-07-24\n                \n            \n        \n\n        \n        \nShort answer: It depends. Git stores \"objects\" as zlib compressed data. So the exact size of a commit will depend on the compressibility of your files (which is basically a function of the amount of repetition in them).\n\nThe other factor is that Git eventually turns object files into even more efficient packfiles, saving additional space by getting rid of redundancy across objects.\n\nFor fun, I did some little experiments (all \"loose objects\" with no packfiles created). Here\u2019s the results:\n\n\n\n64,828 bytes - git init\n\n\n47,640 bytes - committing 250 tiny files\n\n\n17,145 bytes - committing 3 bytes of change to a file in a directory of 50 files\n\n\n8,709 bytes - committing 3 bytes of change to a single-file repo\n\n\n297,873 bytes - committing a 583,840 byte binary file\n\n\n1,622,188 bytes - committing a huge 16,415,223 byte source file\n\n\n\nSo we see kilobytes of overhead for very tiny commits - exactly how much will depend on the size of the file/directory tree involved with the changes.\nFor larger commits with small numbers of files, the stored data in .git will be anywhere from 50% to 10% of the uncompressed committed files.\nIn other words, it\u2019s extremely efficient.\nBelow is the running log of the experiments resulting in the numbers above.\n\nInit, 5 directories, 250 files\n\nFirst, how big is a brand new empty Git directory (.git)?\n\n$ git init\nInitialized empty Git repository in /home/dave/tmp/foo/.git/\n\n$ du -sb .git\n64828\t.git\n\nAbout 64 Kb.\n(The du options are: s to summarize and b to display bytes.)\nNow I\u2019m going to make a bunch of tiny files in directories with a pair of nested shell loops:\n\n$ for d in {1..5};do\n    mkdir $d;\n    for f in {1..50};do\n        echo foo > $d/$f;\n    done;\ndone\n\nNow I have 250 files in 5 directories containing the string \"foo\":\n\n$ ls\n1  2  3  4  5\n$ cat 2/45\nfoo\n\nI\u2019ll commit them:\n\n$ git add .\n$ git commit -m 'initial commit'\n\nLet\u2019s see how big .git is now:\n\nThe commit has added about 47 Kb to the initial blank repo.\nAside: I calculated this in the geekiest way I could think of, using the standard Unix command dc, the arbitrary precicision reverse-polish notation desk calculator (note that 'p' is the print command so we can see the result!):\n\n$ dc -e '112468 64828 - p'\n47640\n\nNow I\u2019ll make one tiny change to one file and commit it:\n\n$ echo bar > 1/1\n$ git commit -am 'changed 1/1'\n\n$ du -sb .git\n129613\n$ dc -e '129613 112468 - p'\n17145\n\nSo that\u2019s 17 Kb to store about 3 bytes of changes to my repo.\nWhere is that weight coming from?\nI\u2019m gonna do another little commit. Here\u2019s what it looks like before:\n\n$ du -b .git\n4096\t.git/objects/info\n4096\t.git/objects/pack\n4115\t.git/objects/25\n4155\t.git/objects/7b\n4225\t.git/objects/af\n4115\t.git/objects/57\n4271\t.git/objects/07\n4177\t.git/objects/61\n4255\t.git/objects/bb\n4299\t.git/objects/a8\n45900\t.git/objects\n4336\t.git/info\n4096\t.git/refs/tags\n4137\t.git/refs/heads\n12329\t.git/refs\n4096\t.git/branches\n4411\t.git/logs/refs/heads\n8507\t.git/logs/refs\n12918\t.git/logs\n27538\t.git/hooks\n129613\t.git\n\nThen I modify file 1/1 again to contain the string 'baz' and commit that.\nAfter:\n\n4096\t.git/objects/info\n4096\t.git/objects/pack\n4115\t.git/objects/25\n4253\t.git/objects/81 <-- new 4 Kb\n4155\t.git/objects/7b\n4225\t.git/objects/af\n4115\t.git/objects/57\n4271\t.git/objects/07\n4177\t.git/objects/61\n4302\t.git/objects/fc <-- new 4 Kb\n4255\t.git/objects/bb\n4115\t.git/objects/76 <-- new 4 Kb\n4299\t.git/objects/a8\n4177\t.git/objects/92 <-- new 4 Kb\n62747\t.git/objects\n4336\t.git/info\n4096\t.git/refs/tags\n4137\t.git/refs/heads\n12329\t.git/refs\n4096\t.git/branches\n4561\t.git/logs/refs/heads <-- added 0.1 Kb\n8657\t.git/logs/refs\n13218\t.git/logs\n27538\t.git/hooks\n146759\t.git\n\nThat\u2019s 4 new objects for a single-file commit.\nThanks to Julia \"b0rk\" Evans\u2019s awesome work on the\nnew Git data model documentation (jvns.ca)\n, I can figure out what these new objects are.\nAlthough these files are all zlib compressed data, I figured out that git show will show the value of any object by hash identifier, not just commits!\nSo to view these objects, I did:\n\n$ ls .git/objects/81\nb1a9d27494b40679d612b96bb6acaac83afa9c\n$ git show 81b1a9d27494b40679d612b96bb6acaac83afa9c\n\nAnd the results are:\n\n\n\n81\u2026\u200b is my actual commit\n\n\nfc\u2026\u200b is the tree file for the changed directory 1., listing all of the files in that directory (1 through 50).\n\n\n76\u2026\u200b is the actual contents of file 1/1 (which is now the string 'baz')\n\n\n92\u2026\u200b is another tree for the root directory of the repo\n\n\n\nThat makes sense. There\u2019s a commit, two trees, and one file.\n\n\n\nTiny repo\n\nHow about a repo with just a single little file. How much space does a commit require then?\n\n$ git init\n$ echo foo > foo\n$ git add foo\n$ git commit -m 'initial'\n$ du -sb .git\n94208\n$ echo bar > foo\n$ git -am 'change1'\n$ du -sb .git\n102917\n$ dc -e '102917 94208 - p'\n8709\n\nSo that\u2019s 8 Kb per commit, about half the size of the repo with a larger tree of files. I suspect a lot of the size of both of these is overhead and larger commits will see substantial savings.\n\n\n\n\"Big\" files?\n\nLet\u2019s add a \"big\" (580 Kb) binary file:\n\n$ cp /usr/bin/librewolf .\n$ du -b librewolf\n583840\n$ git add .\n$ git commit -m 'added librewolf'\n$ du -sb .git\n400790\n$ dc -e '400790 102917 -  p'\n297873\n\nThe binary compresses quite a bit, so the commit is smaller than the added file (300 Kb for a 580 Kb file).\nEven better, a huge (16.2 Mb) text source file:\n\n$ cp /usr/src/linux...mask.h .\n$ du -b nbio_7_2_0_sh_mask.h\n16415223\n$ git add .\n$ git commit -m 'huge source'\n$ du -sb .git\n2022978\n$ dc -e '2022978 400790 - p'\n1622188\n\nSo that\u2019s 1.6 Mb to commit a 16.4 Mb source file! I expected the text to compress nicely, but that\u2019s really impressive."
                ],
                "output": "readability",
                "pwd": "/data/archive/1791713075.907406",
                "schema": "ArchiveResult",
                "start_ts": "2026-10-11T10:05:30.987484+00:00",
                "status": "succeeded"
            },
            {
                "cmd": [
                    "/app/node_modules/readability-extractor/readability-extractor",
                    "/tmp/tmp_9iqvmdm",
                    "https://ratfactor.com/cards/git-commit-size"
                ],
                "cmd_version": "0.0.11",
                "end_ts": "2026-10-11T19:27:08.264867+00:00",
                "index_texts": [
                    "Page created: 2026-01-10\n            \n            \n            \n            \n                Updated: 2026-07-24\n                \n            \n        \n\n        \n        \nShort answer: It depends. Git stores \"objects\" as zlib compressed data. So the exact size of a commit will depend on the compressibility of your files (which is basically a function of the amount of repetition in them).\n\nThe other factor is that Git eventually turns object files into even more efficient packfiles, saving additional space by getting rid of redundancy across objects.\n\nFor fun, I did some little experiments (all \"loose objects\" with no packfiles created). Here\u2019s the results:\n\n\n\n64,828 bytes - git init\n\n\n47,640 bytes - committing 250 tiny files\n\n\n17,145 bytes - committing 3 bytes of change to a file in a directory of 50 files\n\n\n8,709 bytes - committing 3 bytes of change to a single-file repo\n\n\n297,873 bytes - committing a 583,840 byte binary file\n\n\n1,622,188 bytes - committing a huge 16,415,223 byte source file\n\n\n\nSo we see kilobytes of overhead for very tiny commits - exactly how much will depend on the size of the file/directory tree involved with the changes.\nFor larger commits with small numbers of files, the stored data in .git will be anywhere from 50% to 10% of the uncompressed committed files.\nIn other words, it\u2019s extremely efficient.\nBelow is the running log of the experiments resulting in the numbers above.\n\nInit, 5 directories, 250 files\n\nFirst, how big is a brand new empty Git directory (.git)?\n\n$ git init\nInitialized empty Git repository in /home/dave/tmp/foo/.git/\n\n$ du -sb .git\n64828\t.git\n\nAbout 64 Kb.\n(The du options are: s to summarize and b to display bytes.)\nNow I\u2019m going to make a bunch of tiny files in directories with a pair of nested shell loops:\n\n$ for d in {1..5};do\n    mkdir $d;\n    for f in {1..50};do\n        echo foo > $d/$f;\n    done;\ndone\n\nNow I have 250 files in 5 directories containing the string \"foo\":\n\n$ ls\n1  2  3  4  5\n$ cat 2/45\nfoo\n\nI\u2019ll commit them:\n\n$ git add .\n$ git commit -m 'initial commit'\n\nLet\u2019s see how big .git is now:\n\nThe commit has added about 47 Kb to the initial blank repo.\nAside: I calculated this in the geekiest way I could think of, using the standard Unix command dc, the arbitrary precicision reverse-polish notation desk calculator (note that 'p' is the print command so we can see the result!):\n\n$ dc -e '112468 64828 - p'\n47640\n\nNow I\u2019ll make one tiny change to one file and commit it:\n\n$ echo bar > 1/1\n$ git commit -am 'changed 1/1'\n\n$ du -sb .git\n129613\n$ dc -e '129613 112468 - p'\n17145\n\nSo that\u2019s 17 Kb to store about 3 bytes of changes to my repo.\nWhere is that weight coming from?\nI\u2019m gonna do another little commit. Here\u2019s what it looks like before:\n\n$ du -b .git\n4096\t.git/objects/info\n4096\t.git/objects/pack\n4115\t.git/objects/25\n4155\t.git/objects/7b\n4225\t.git/objects/af\n4115\t.git/objects/57\n4271\t.git/objects/07\n4177\t.git/objects/61\n4255\t.git/objects/bb\n4299\t.git/objects/a8\n45900\t.git/objects\n4336\t.git/info\n4096\t.git/refs/tags\n4137\t.git/refs/heads\n12329\t.git/refs\n4096\t.git/branches\n4411\t.git/logs/refs/heads\n8507\t.git/logs/refs\n12918\t.git/logs\n27538\t.git/hooks\n129613\t.git\n\nThen I modify file 1/1 again to contain the string 'baz' and commit that.\nAfter:\n\n4096\t.git/objects/info\n4096\t.git/objects/pack\n4115\t.git/objects/25\n4253\t.git/objects/81 <-- new 4 Kb\n4155\t.git/objects/7b\n4225\t.git/objects/af\n4115\t.git/objects/57\n4271\t.git/objects/07\n4177\t.git/objects/61\n4302\t.git/objects/fc <-- new 4 Kb\n4255\t.git/objects/bb\n4115\t.git/objects/76 <-- new 4 Kb\n4299\t.git/objects/a8\n4177\t.git/objects/92 <-- new 4 Kb\n62747\t.git/objects\n4336\t.git/info\n4096\t.git/refs/tags\n4137\t.git/refs/heads\n12329\t.git/refs\n4096\t.git/branches\n4561\t.git/logs/refs/heads <-- added 0.1 Kb\n8657\t.git/logs/refs\n13218\t.git/logs\n27538\t.git/hooks\n146759\t.git\n\nThat\u2019s 4 new objects for a single-file commit.\nThanks to Julia \"b0rk\" Evans\u2019s awesome work on the\nnew Git data model documentation (jvns.ca)\n, I can figure out what these new objects are.\nAlthough these files are all zlib compressed data, I figured out that git show will show the value of any object by hash identifier, not just commits!\nSo to view these objects, I did:\n\n$ ls .git/objects/81\nb1a9d27494b40679d612b96bb6acaac83afa9c\n$ git show 81b1a9d27494b40679d612b96bb6acaac83afa9c\n\nAnd the results are:\n\n\n\n81\u2026\u200b is my actual commit\n\n\nfc\u2026\u200b is the tree file for the changed directory 1., listing all of the files in that directory (1 through 50).\n\n\n76\u2026\u200b is the actual contents of file 1/1 (which is now the string 'baz')\n\n\n92\u2026\u200b is another tree for the root directory of the repo\n\n\n\nThat makes sense. There\u2019s a commit, two trees, and one file.\n\n\n\nTiny repo\n\nHow about a repo with just a single little file. How much space does a commit require then?\n\n$ git init\n$ echo foo > foo\n$ git add foo\n$ git commit -m 'initial'\n$ du -sb .git\n94208\n$ echo bar > foo\n$ git -am 'change1'\n$ du -sb .git\n102917\n$ dc -e '102917 94208 - p'\n8709\n\nSo that\u2019s 8 Kb per commit, about half the size of the repo with a larger tree of files. I suspect a lot of the size of both of these is overhead and larger commits will see substantial savings.\n\n\n\n\"Big\" files?\n\nLet\u2019s add a \"big\" (580 Kb) binary file:\n\n$ cp /usr/bin/librewolf .\n$ du -b librewolf\n583840\n$ git add .\n$ git commit -m 'added librewolf'\n$ du -sb .git\n400790\n$ dc -e '400790 102917 -  p'\n297873\n\nThe binary compresses quite a bit, so the commit is smaller than the added file (300 Kb for a 580 Kb file).\nEven better, a huge (16.2 Mb) text source file:\n\n$ cp /usr/src/linux...mask.h .\n$ du -b nbio_7_2_0_sh_mask.h\n16415223\n$ git add .\n$ git commit -m 'huge source'\n$ du -sb .git\n2022978\n$ dc -e '2022978 400790 - p'\n1622188\n\nSo that\u2019s 1.6 Mb to commit a 16.4 Mb source file! I expected the text to compress nicely, but that\u2019s really impressive."
                ],
                "output": "readability",
                "pwd": "/data/archive/1791713075.907406",
                "schema": "ArchiveResult",
                "start_ts": "2026-10-11T19:27:06.567985+00:00",
                "status": "succeeded"
            }
        ],
        "screenshot": [],
        "singlefile": [],
        "title": [
            {
                "cmd": [
                    "curl",
                    "--silent",
                    "--location",
                    "--compressed",
                    "--max-time",
                    "120",
                    "--user-agent",
                    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 ArchiveBox/0.7.4 (+https://github.com/ArchiveBox/ArchiveBox/) curl/curl 8.14.1 (x86_64-pc-linux-gnu)",
                    "https://ratfactor.com/cards/git-commit-size"
                ],
                "cmd_version": "curl 8.14.1 (x86_64-pc-linux-gnu)",
                "end_ts": "2026-10-11T16:29:21.355743+00:00",
                "index_texts": null,
                "output": "How big is a Git commit? - ratfactor",
                "pwd": "/data/archive/1791713075.907406",
                "schema": "ArchiveResult",
                "start_ts": "2026-10-11T16:29:21.345558+00:00",
                "status": "succeeded"
            },
            {
                "cmd": [
                    "curl",
                    "--silent",
                    "--location",
                    "--compressed",
                    "--max-time",
                    "120",
                    "--user-agent",
                    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 ArchiveBox/0.7.4 (+https://github.com/ArchiveBox/ArchiveBox/) curl/curl 8.14.1 (x86_64-pc-linux-gnu)",
                    "https://ratfactor.com/cards/git-commit-size"
                ],
                "cmd_version": "curl 8.14.1 (x86_64-pc-linux-gnu)",
                "end_ts": "2026-10-11T10:05:30.979948+00:00",
                "index_texts": null,
                "output": "How big is a Git commit? - ratfactor",
                "pwd": "/data/archive/1791713075.907406",
                "schema": "ArchiveResult",
                "start_ts": "2026-10-11T10:05:30.968335+00:00",
                "status": "succeeded"
            },
            {
                "cmd": [
                    "curl",
                    "--silent",
                    "--location",
                    "--compressed",
                    "--max-time",
                    "120",
                    "--user-agent",
                    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 ArchiveBox/0.7.4 (+https://github.com/ArchiveBox/ArchiveBox/) curl/curl 8.14.1 (x86_64-pc-linux-gnu)",
                    "https://ratfactor.com/cards/git-commit-size"
                ],
                "cmd_version": "curl 8.14.1 (x86_64-pc-linux-gnu)",
                "end_ts": "2026-10-11T19:27:06.563345+00:00",
                "index_texts": null,
                "output": "How big is a Git commit? - ratfactor",
                "pwd": "/data/archive/1791713075.907406",
                "schema": "ArchiveResult",
                "start_ts": "2026-10-11T19:27:06.553882+00:00",
                "status": "succeeded"
            }
        ],
        "wget": [
            {
                "cmd": [
                    "wget",
                    "--no-verbose",
                    "--adjust-extension",
                    "--convert-links",
                    "--force-directories",
                    "--span-hosts",
                    "--no-parent",
                    "-e",
                    "robots=off",
                    "--reject=js,mjs,woff,woff2,ttf,otf,eot,mp4,m4v,mov,webm,ogv,mkv,avi,flv",
                    "--timeout=120",
                    "--restrict-file-names=windows",
                    "--page-requisites",
                    "--user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 ArchiveBox/0.7.4 (+https://github.com/ArchiveBox/ArchiveBox/) wget/GNU Wget 1.21.3",
                    "--compression=auto",
                    "--timestamping",
                    "https://ratfactor.com/cards/git-commit-size"
                ],
                "cmd_version": "GNU Wget 1.21.3",
                "end_ts": "2026-10-11T16:29:21.339886+00:00",
                "index_texts": null,
                "output": "ratfactor.com/cards/git-commit-size.html",
                "pwd": "/data/archive/1791713075.907406",
                "schema": "ArchiveResult",
                "start_ts": "2026-10-11T16:29:19.202185+00:00",
                "status": "succeeded"
            },
            {
                "cmd": [
                    "wget",
                    "--no-verbose",
                    "--adjust-extension",
                    "--convert-links",
                    "--force-directories",
                    "--span-hosts",
                    "--no-parent",
                    "-e",
                    "robots=off",
                    "--reject=js,mjs,woff,woff2,ttf,otf,eot,mp4,m4v,mov,webm,ogv,mkv,avi,flv",
                    "--timeout=120",
                    "--restrict-file-names=windows",
                    "--page-requisites",
                    "--user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 ArchiveBox/0.7.4 (+https://github.com/ArchiveBox/ArchiveBox/) wget/GNU Wget 1.21.3",
                    "--compression=auto",
                    "--timestamping",
                    "https://ratfactor.com/cards/git-commit-size"
                ],
                "cmd_version": "GNU Wget 1.21.3",
                "end_ts": "2026-10-11T10:05:30.960256+00:00",
                "index_texts": null,
                "output": "ratfactor.com/cards/git-commit-size.html",
                "pwd": "/data/archive/1791713075.907406",
                "schema": "ArchiveResult",
                "start_ts": "2026-10-11T10:05:28.156772+00:00",
                "status": "succeeded"
            },
            {
                "cmd": [
                    "wget",
                    "--no-verbose",
                    "--adjust-extension",
                    "--convert-links",
                    "--force-directories",
                    "--span-hosts",
                    "--no-parent",
                    "-e",
                    "robots=off",
                    "--reject=js,mjs,woff,woff2,ttf,otf,eot,mp4,m4v,mov,webm,ogv,mkv,avi,flv",
                    "--timeout=120",
                    "--restrict-file-names=windows",
                    "--page-requisites",
                    "--user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 ArchiveBox/0.7.4 (+https://github.com/ArchiveBox/ArchiveBox/) wget/GNU Wget 1.21.3",
                    "--compression=auto",
                    "--timestamping",
                    "https://ratfactor.com/cards/git-commit-size"
                ],
                "cmd_version": "GNU Wget 1.21.3",
                "end_ts": "2026-10-11T19:27:06.546877+00:00",
                "index_texts": null,
                "output": "ratfactor.com/cards/git-commit-size.html",
                "pwd": "/data/archive/1791713075.907406",
                "schema": "ArchiveResult",
                "start_ts": "2026-10-11T19:27:04.148777+00:00",
                "status": "succeeded"
            }
        ]
    },
    "icons": null,
    "is_archived": true,
    "is_static": false,
    "latest": {
        "archive_org": null,
        "dom": null,
        "favicon": "favicon.ico",
        "git": null,
        "media": null,
        "pdf": null,
        "screenshot": null,
        "singlefile": null,
        "title": "How big is a Git commit? - ratfactor",
        "warc": null,
        "wget": "ratfactor.com/cards/git-commit-size.html"
    },
    "link_dir": "/data/archive/1791713075.907406",
    "newest_archive_date": "2026-10-11T19:27:08.272808+00:00",
    "num_failures": 0,
    "num_outputs": 18,
    "oldest_archive_date": "2026-10-11T10:05:26.638242+00:00",
    "path": "/cards/git-commit-size",
    "schema": "Link",
    "scheme": "https",
    "snapshot_id": "78c2ff18-e35c-445a-85e7-533716264d5e",
    "sources": [
        "/data/sources/1791713075-import.txt"
    ],
    "tags": ",war-wiki",
    "tags_str": "war-wiki",
    "timestamp": "1791713075.907406",
    "title": "How big is a Git commit? - ratfactor",
    "updated": "2026-10-11T19:27:02.193454+00:00",
    "updated_date": "2026-10-11 19:27",
    "url": "https://ratfactor.com/cards/git-commit-size"
}