Created
January 14, 2014 15:23
-
-
Save Abizern/8420005 to your computer and use it in GitHub Desktop.
Recurse the current directory and run git gc on all non-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 non-bare repositories | |
| Dir.glob("**/.git") do |dir| | |
| working_dir = File.dirname dir | |
| puts "#{working_dir} being garbage collected." | |
| `cd #{File.expand_path 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