-
-
Save evnm/6227816 to your computer and use it in GitHub Desktop.
A Git maintenance script. Prunes remote-tracking branches on origin and performs a deep repack on the repository.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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