Staging
v0.5.1
swh:1:snp:c5feb7ee9221a3820c8879e85e8a18470c0b3afa
Raw File
Tip revision: 5c553ea2de0e21cb843eaf49b1820f9e395c76a3 authored by Junio C Hamano on 07 February 2007, 22:31:21 UTC
GIT v1.5.0-rc4
Tip revision: 5c553ea
git-gc.sh
#!/bin/sh
#
# Copyright (c) 2006, Shawn O. Pearce
#
# Cleanup unreachable files and optimize the repository.

USAGE='git-gc [--prune]'
SUBDIRECTORY_OK=Yes
. git-sh-setup

no_prune=:
while case $# in 0) break ;; esac
do
	case "$1" in
	--prune)
		no_prune=
		;;
	--)
		usage
		;;
	esac
	shift
done

git-pack-refs --prune &&
git-reflog expire --all &&
git-repack -a -d -l &&
$no_prune git-prune &&
git-rerere gc || exit
back to top