@@ -26,6 +26,7 @@ To demonstrate, we'll add the `repo.rb` file from the Grit library – this is a
2626[source,console]
2727----
2828$ curl https://raw.githubusercontent.com/mojombo/grit/master/lib/grit/repo.rb > repo.rb
29+ $ git checkout master
2930$ git add repo.rb
3031$ git commit -m 'added repo.rb'
3132[master 484a592] added repo.rb
@@ -81,7 +82,7 @@ $ git cat-file -s b042a60ef7dff760008df33cee372b945b6e884e
818222054
8283----
8384
84- You have two nearly identical 22K objects on your disk.
85+ You have two nearly identical 22K objects on your disk (each compressed to approximately 7K) .
8586Wouldn't it be nice if Git could store one of them in full but then the second object only as the delta between it and the first?
8687
8788It turns out that it can.
@@ -118,8 +119,8 @@ Because you never added them to any commits, they're considered dangling and are
118119The other files are your new packfile and an index.
119120The packfile is a single file containing the contents of all the objects that were removed from your filesystem.
120121The index is a file that contains offsets into that packfile so you can quickly seek to a specific object.
121- What is cool is that although the objects on disk before you ran the `gc` were collectively about 22K in size, the new packfile is only 7K.
122- You've cut your disk usage by ⅔ by packing your objects.
122+ What is cool is that although the objects on disk before you ran the `gc` were collectively about 15K in size, the new packfile is only 7K.
123+ You've cut your disk usage by ½ by packing your objects.
123124
124125How does Git do this?
125126When Git packs objects, it looks for files that are named and sized similarly, and stores just the deltas from one version of the file to the next.
0 commit comments