Skip to content

Instantly share code, notes, and snippets.

@AykutCevik
Last active July 10, 2017 14:00
Show Gist options
  • Save AykutCevik/69b214ae315873d5166d6212fc4e7d35 to your computer and use it in GitHub Desktop.
Save AykutCevik/69b214ae315873d5166d6212fc4e7d35 to your computer and use it in GitHub Desktop.
Git: Cleanup unnecessary files and optimize all the repositories in one directory
#!/bin/bash
find . -type d -depth 1 -exec git --git-dir={}/.git --work-tree=$PWD/{} gc --aggressive \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment