Fix git-tag -u
[git/jnareb-git/bp-gitweb.git] / git-gc.sh
blob3e8c87c814baaef650484cdd77484858c09e29c4
1 #!/bin/sh
3 # Copyright (c) 2006, Shawn O. Pearce
5 # Cleanup unreachable files and optimize the repository.
7 USAGE='git-gc [--prune]'
8 SUBDIRECTORY_OK=Yes
9 . git-sh-setup
11 no_prune=:
12 while case $# in 0) break ;; esac
14 case "$1" in
15 --prune)
16 no_prune=
18 --)
19 usage
21 esac
22 shift
23 done
25 git-pack-refs --prune &&
26 git-reflog expire --all &&
27 git-repack -a -d -l &&
28 $no_prune git-prune &&
29 git-rerere gc || exit