Skip to content

Instantly share code, notes, and snippets.

@dysinger
Created November 30, 2011 18:55
Show Gist options
  • Save dysinger/1410287 to your computer and use it in GitHub Desktop.
Save dysinger/1410287 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