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