4. One copy of each file, and packs underneath
Snapshots do not multiply storage: identical content is stored once, and packs store the newest version of a file whole and older versions as deltas.

4. One copy of each file, and packs underneath

Snapshots do not multiply storage: identical content is stored once, and packs store the newest version of a file whole and older versions as deltas.

It removes the main objection to the snapshot model and explains why repositories stay small.

A photo of every file, every commit. That sounds like a lot of space.

It is not. Identical content has the identical name. So Git keeps one copy, and every photo points at it.

A file you edit does get a new blob. One line added to a long file, a whole new copy.

Now and then Git packs. It keeps the newest version whole. Older versions are stored as differences from it.

So photos are what you see. Differences are a storage trick underneath. You never have to think about them.

Check yourself. You commit ten times without touching a large image. How many copies of the image does Git hold?

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime

Attributes
name
4. One copy of each file, and packs underneath
summary
Snapshots do not multiply storage: identical content is stored once, and packs store the newest version of a file whole and older versions as deltas.