Git Version Control Cookbook - Second Edition
by Kenneth Geisshirt, Emanuele Zattin(EUR), Aske Olsson, Rasmus Voss
How it works...
The git gc command optimizes the repository by compressing file revisions and deleting objects that there are no references to. The objects can be commits, and so on. On an abandoned (deleted) branch, blobs from invocations of git add, commits discarded/redone with git commit --amend, or other commands can leave objects behind. Objects are, by default, already compressed with zlib when they are created and, when moved into the pack file, Git makes sure to only store the necessary changes. For example, if you change only a single line in a large file, storing the entire file in the pack file again would waste a bit of space. Instead, Git stores the latest file as a whole in the pack file and only the delta for the older version. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access