Skip to content

Instantly share code, notes, and snippets.

Last active Dec 21, 2015
What would you like to do?
A Git maintenance script. Prunes remote-tracking branches on origin and performs a deep repack on the repository.
#! /bin/sh
# A Git maintenance script.
set -e
root=`git rev-parse --show-toplevel`
echo "Performing maintenance tasks on Git repository in ${root}..."
git fetch
git remote prune origin
git repack -a -d --depth=250 --window=250
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment