diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2006-12-27 02:17:59 -0500 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-12-27 01:53:03 -0800 |
commit | 30f610b7b09a579aeba343317114bf18b4fd92bf (patch) | |
tree | 010e90ddf832d8d51567fffc6a00aa6038d57303 /git-gc.sh | |
parent | 4aec56d12ba66a321ce8a6db2ab60f81be5ccfc5 (diff) | |
download | git-30f610b7b09a579aeba343317114bf18b4fd92bf.tar.gz |
Create 'git gc' to perform common maintenance operations.
Junio asked for a 'git gc' utility which users can execute on a
regular basis to perform basic repository actions such as:
* pack-refs --prune
* reflog expire
* repack -a -d
* prune
* rerere gc
So here is a command which does exactly that. The parameters fed
to reflog's expire subcommand can be chosen by the user by setting
configuration options in .git/config (or ~/.gitconfig), as users may
want different expiration windows for each repository but shouldn't
be bothered to remember what they are all of the time.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-gc.sh')
-rwxr-xr-x | git-gc.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/git-gc.sh b/git-gc.sh new file mode 100755 index 0000000000..e55ed19fbd --- /dev/null +++ b/git-gc.sh @@ -0,0 +1,15 @@ +#!/bin/sh +# +# Copyright (c) 2006, Shawn O. Pearce +# +# Cleanup unreachable files and optimize the repository. + +USAGE='' +SUBDIRECTORY_OK=Yes +. git-sh-setup + +git-pack-refs --prune && +git-reflog expire --all && +git-repack -a -d && +git-prune && +git-rerere gc || exit |