Skip to content

Instantly share code, notes, and snippets.

@mhorbul
Forked from dysinger/cookbooks.sh
Created March 13, 2012 22:46
Show Gist options
  • Save mhorbul/2032353 to your computer and use it in GitHub Desktop.
Save mhorbul/2032353 to your computer and use it in GitHub Desktop.
Re-write Opscode Cookbooks as individual Git repos
#!/bin/bash
for cookbook in $(find * -type d -maxdepth 0); do
git clone ./ ../${cookbook}
cd ../${cookbook}
git remote rm origin
git filter-branch --subdirectory-filter ${cookbook} -- --all
git gc --aggressive
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment