everyday: replace 'prune' and 'repack' with 'gc'
In everyday tasks, "repack -a -d -f" won't be used, so there is not much point mentioning "repack". By showing the --prune option to "gc", we can do without mentioning "git prune", too. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
feb7f38b01
commit
8a82b13354
@ -30,10 +30,6 @@ Everybody uses these commands to maintain git repositories.
|
|||||||
|
|
||||||
* gitlink:git-fsck[1] to check the repository for errors.
|
* gitlink:git-fsck[1] to check the repository for errors.
|
||||||
|
|
||||||
* gitlink:git-prune[1] to remove unused objects in the repository.
|
|
||||||
|
|
||||||
* gitlink:git-repack[1] to pack loose objects for efficiency.
|
|
||||||
|
|
||||||
* gitlink:git-gc[1] to do common housekeeping tasks such as
|
* gitlink:git-gc[1] to do common housekeeping tasks such as
|
||||||
repack and prune.
|
repack and prune.
|
||||||
|
|
||||||
@ -45,24 +41,21 @@ Check health and remove cruft.::
|
|||||||
------------
|
------------
|
||||||
$ git fsck <1>
|
$ git fsck <1>
|
||||||
$ git count-objects <2>
|
$ git count-objects <2>
|
||||||
$ git repack <3>
|
$ git gc <3>
|
||||||
$ git gc <4>
|
|
||||||
------------
|
------------
|
||||||
+
|
+
|
||||||
<1> running without `\--full` is usually cheap and assures the
|
<1> running without `\--full` is usually cheap and assures the
|
||||||
repository health reasonably well.
|
repository health reasonably well.
|
||||||
<2> check how many loose objects there are and how much
|
<2> check how many loose objects there are and how much
|
||||||
disk space is wasted by not repacking.
|
disk space is wasted by not repacking.
|
||||||
<3> without `-a` repacks incrementally. repacking every 4-5MB
|
<3> repacks the local repository and performs other housekeeping tasks. Running
|
||||||
of loose objects accumulation may be a good rule of thumb.
|
without `--prune` is a safe operation even while other ones are in progress.
|
||||||
<4> it is easier to use `git gc` than individual housekeeping commands
|
|
||||||
such as `prune` and `repack`. This runs `repack -a -d`.
|
|
||||||
|
|
||||||
Repack a small project into single pack.::
|
Repack a small project into single pack.::
|
||||||
+
|
+
|
||||||
------------
|
------------
|
||||||
$ git repack -a -d <1>
|
$ git gc <1>
|
||||||
$ git prune
|
$ git gc --prune
|
||||||
------------
|
------------
|
||||||
+
|
+
|
||||||
<1> pack all the objects reachable from the refs into one pack,
|
<1> pack all the objects reachable from the refs into one pack,
|
||||||
@ -189,7 +182,7 @@ $ git pull <3>
|
|||||||
$ git log -p ORIG_HEAD.. arch/i386 include/asm-i386 <4>
|
$ git log -p ORIG_HEAD.. arch/i386 include/asm-i386 <4>
|
||||||
$ git pull git://git.kernel.org/pub/.../jgarzik/libata-dev.git ALL <5>
|
$ git pull git://git.kernel.org/pub/.../jgarzik/libata-dev.git ALL <5>
|
||||||
$ git reset --hard ORIG_HEAD <6>
|
$ git reset --hard ORIG_HEAD <6>
|
||||||
$ git prune <7>
|
$ git gc --prune <7>
|
||||||
$ git fetch --tags <8>
|
$ git fetch --tags <8>
|
||||||
------------
|
------------
|
||||||
+
|
+
|
||||||
|
Loading…
Reference in New Issue
Block a user