Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check out a Git repository with chef?

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

like image 673
Victor Pudeyev Avatar asked Aug 01 '12 23:08

Victor Pudeyev


People also ask

How do I checkout from GitHub?

This is accomplished by entering the command 'git branch' in the command line. After entering the command you will be presented with a list of all available branches in your repository. These are the branches that you can switch to using the checkout command.

How do I checkout from GitHub command line?

Open “Git Bash” and change the current working directory to the location where you want the cloned directory. Type git clone in the terminal, paste the URL you copied earlier, and press “enter” to create your local clone.

How do I view a git repository?

In the left sidebar, under the list of repositories, use the "Manage notifications" drop-down menu and click Watched repositories. Evaluate the repositories that you are watching and decide if their updates are still relevant and helpful.

What is a checked out repository?

The git checkout command navigates between two different branches in a Git repository. Checkout is used to view and make changes to different branches. You can check out a past commit in a repository to view how your project appeared in that state.


1 Answers

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.

like image 171
Marc Paradise Avatar answered Oct 21 '22 22:10

Marc Paradise