Check out a Git repository with chef?

Victor Pudeyev picture Victor Pudeyev · Aug 2, 2012 · Viewed 20.6k times · Source

I have a Git repository I would like to check out onto a server. Is there a Chef recipe that does that?

Answer

Marc Paradise picture Marc Paradise · Aug 2, 2012

The git SCM resource is probably what you're looking for. Simple resource usage example:

git "/path/to/check/out/to" do
  repository "git://github.com/opscode/chef.git"
  reference "master"
  action :sync
end

Also see "revision" attribute if you want to grab a specific branch.