@@ -26,6 +26,7 @@ To demonstrate, we'll add the `repo.rb` file from the Grit library – this is a
26
26
[source,console]
27
27
----
28
28
$ curl https://raw.githubusercontent.com/mojombo/grit/master/lib/grit/repo.rb > repo.rb
29
+ $ git checkout master
29
30
$ git add repo.rb
30
31
$ git commit -m 'added repo.rb'
31
32
[master 484a592] added repo.rb
@@ -81,7 +82,7 @@ $ git cat-file -s b042a60ef7dff760008df33cee372b945b6e884e
81
82
22054
82
83
----
83
84
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) .
85
86
Wouldn'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?
86
87
87
88
It turns out that it can.
@@ -118,8 +119,8 @@ Because you never added them to any commits, they're considered dangling and are
118
119
The other files are your new packfile and an index.
119
120
The packfile is a single file containing the contents of all the objects that were removed from your filesystem.
120
121
The 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.
123
124
124
125
How does Git do this?
125
126
When 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