Tips for injecting cookbooks from chef-repo to git repo


We have set up a basic chef server, initially not backed with a git repository.

Now we would like to build this git repository to gain some agility in cookbooks development.

Is there a tool that could help in extracting all cookbooks from chef-repo (with their different versions), and commit them to their dedicated git repo, or do I have to perform it manually for each cookbook ?

Thanks in advance,


I would create a new repo, initiating it, then just run a

knife download cookbooks/

The next step is to:

git add .
git commit -m 'adding all cookbooks'
git push

Every time you modify something in the local folder, commit the changes in git.

Separately, I would use a Jenkins job that would be triggered (with git plugin) everytime you make a commit and that job would upload the modified files (cookbooks/roles/nodes jsons) to chef server.