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