Created
January 14, 2014 15:26
-
-
Save Abizern/8420056 to your computer and use it in GitHub Desktop.
Recurse the current directory and run git gc on all bare repositories.
This file contains hidden or 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
#!/usr/bin/env ruby | |
# A simple script that recurses through the current directory and runs | |
# git garbage collection on the bare repositories | |
Dir.glob("**/*.git") do |dir| | |
working_dir = File.expand_path dir | |
puts "#{dir} being garbage collected." | |
`cd #{working_dir};git gc --aggressive --prune --quiet` | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment