@matheusbsbs / matheus-bagliano / commits / c82365dc6f
Fork 0

Documentation: git-prune

Not replacing but always including our own refs may be more desirable (and unarguably much safer), but at the same time I have a suspicion that that might be forbidding a useful usage I haven't thought of, so... Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Dec 8, 2005 at 16:30 UTC c82365dc6f211722cbbed96f41a61f477914c91a
1 file changed +29 -1
Documentation/git-prune.txt
+29 -1
@@ -8,7 +8,7 @@ git-prune - Prunes all unreachable objects from the object database
8
9 SYNOPSIS
10 --------
11 -'git-prune' [-n]
11 +'git-prune' [-n] [--] [<head>...]
12
13 DESCRIPTION
14 -----------
@@ -27,6 +27,34 @@ OPTIONS
27 Do not remove anything; just report what it would
28 remove.
29
30 +--::
31 + Do not interpret any more arguments as options.
32 +
33 +<head>...::
34 + Instead of keeping objects
35 + reachable from any of our references, keep objects
36 + reachable from only listed <head>s.
37 ++
38 +Note that the explicitly named <head>s are *not* appended to the
39 +default set of references, but they replace them. In general you
40 +would want to say `git prune $(git-rev-parse --all) extra1
41 +extra2` to keep chains of commits leading to extra1, extra2,
42 +... in addition to what are reachable from your own refs.
43 +Saying `git prune extra1 extra2` would *lose* objects reachable
44 +only from the usual refs, which is usually not what you want.
45 +
46 +
47 +EXAMPLE
48 +-------
49 +
50 +To prune objects not used by your repository and another that
51 +borrows from your repository via its
52 +`.git/objects/info/alternates`:
53 +
54 +------------
55 +$ git prune $(git-rev-parse --all) \
56 + $(cd ../another && $(git-rev-parse --all))
57 +------------
58
59 Author
60 ------