Skip to content

Commit fae1a90

Browse files
committed
Documentation/gc: warn against --prune=<now>
"git gc" is safe to run anytime only because it has the built-in grace period to protect objects that are created by other processes that are waiting for ref updates to anchor them to the history. In order to run with no grace period, the user must make sure that the repository is quiescent. Reviewed-by: Matthieu Moy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 441c4a4 commit fae1a90

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Documentation/git-gc.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,11 @@ automatic consolidation of packs.
6363
--prune=<date>::
6464
Prune loose objects older than date (default is 2 weeks ago,
6565
overridable by the config variable `gc.pruneExpire`).
66-
--prune=all prunes loose objects regardless of their age.
67-
--prune is on by default.
66+
--prune=all prunes loose objects regardless of their age (do
67+
not use --prune=all unless you know exactly what you are doing.
68+
Unless the repository is quiescent, you will lose newly created
69+
objects that haven't been anchored with the refs and end up
70+
corrupting your repository). --prune is on by default.
6871

6972
--no-prune::
7073
Do not prune any loose objects.

0 commit comments

Comments
 (0)