Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Maintaining git repo with git gc and git fsck #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 11, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions committing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -455,3 +455,27 @@ Forking repository

Forking a repository on GitHub is as simple as clicking Fork button in the right
upper corner at https://github.com/python/cpython.


Maintaining a repository
-------------------------

The Git object database and other files/directories under ``.git`` require
periodic maintenance and cleanup. For example, commit editing leaves
unreferenced objects (dangling objects, in git terminology) and these
objects should be pruned to avoid collecting cruft in the DB. The
command ``git gc`` is used for maintenance. Git automatically runs
``git gc --auto`` as a part of some commands to do quick maintenance.
Users are recommended to run ``git gc --aggressive`` from time to
time; ``git help gc`` recommends to run it every few hundred
changesets; for CPython it should be something like once a week
(GitHub itself runs the command weekly, so new checkouts do not need to
perform this step).

``git gc --aggressive`` not only removes dangling objects, it also
repacks object database into indexed and better optimized pack(s); it
also packs symbolic references (branches and tags).

From time to time run ``git fsck --strict`` to verify integrity of
the database. ``git fsck`` may produce a list of dangling objects;
that's not an error, just a reminder to perform regular maintenance.