Create 'git gc' to perform common maintenance operations.
[alt-git.git] / git-gc.sh
blobe55ed19fbd2ec3bdc748e855f13397b1187fdafb
1 #!/bin/sh
3 # Copyright (c) 2006, Shawn O. Pearce
5 # Cleanup unreachable files and optimize the repository.
7 USAGE=''
8 SUBDIRECTORY_OK=Yes
9 . git-sh-setup
11 git-pack-refs --prune &&
12 git-reflog expire --all &&
13 git-repack -a -d &&
14 git-prune &&
15 git-rerere gc || exit