Skip to Main Content
Pragmatic Guide to Git
book

Pragmatic Guide to Git

by Travis Swicegood
November 2010
Beginner content levelBeginner
160 pages
2h 50m
English
Pragmatic Bookshelf
Content preview from Pragmatic Guide to Git
42 Doing Some Git Housekeeping

One of Git’s key advantages is its speed. Keeping it fast requires some tuning, however. The git gc command provides the tuning tool.

git gc performs several housecleaning tasks. First, it removes any “loose objects” in the repository over a certain age. All of those commits you remove via git rebase, git reset, and so on, are still tracked by Git; they’re just orphaned.

Second, it recalculates the deltas. Deltas are the differences between two pieces of content in the repository. Many times the first pass at creating the delta is not the most efficient. Recalculating the deltas with the help of hindsight allows Git to combine like deltas to reduce the size of the repository and decrease the time Git spends ...

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.
Start your free trial

You might also like

Pragmatic Version Control Using Git

Pragmatic Version Control Using Git

Travis Swicegood
Git Version Control Cookbook - Second Edition

Git Version Control Cookbook - Second Edition

Kenneth Geisshirt, Emanuele Zattin(EUR), Aske Olsson, Rasmus Voss
Git for Programmers

Git for Programmers

Jesse Liberty

Publisher Resources

ISBN: 9781680500028Errata