Creating a Chef Repository - nshenry03/chef-repo GitHub Wiki

For more information about chef repositories, see About the Repository from the Opscode documentation.

In most cases, you will want to store your chef repository in a private repository; therefore, we will need to duplicate this repository, rather than simply forking it.

Make a bare clone of the repository

git clone --bare [email protected]:nshenry03/chef-repo.git old-chef-repo.git

Mirror-push to the new repository

Create a new, empty private repository on GitHub (or any other git repository - beanstalk for example), then push the data from this repository to it:

cd old-chef-repo.git
git push --mirror [email protected]:your-username/your-new-private-repository.git

Remove the temporary local repository

cd ..
rm -rf old-chef-repo.git

Clone your new repository

git clone [email protected]:your-username/your-new-private-repository.git chef-repo

Assign the original repository to a remote called "upstream" [OPTIONAL]

cd chef-repo
git remote add upstream [email protected]:nshenry03/chef-repo.git

Then, if this repository gets updated, you can add those updates to your repository by running the following code:

# Fetch any new changes from the original repository
git fetch upstream

# Merge any changes fetched into your working files
git merge upstream/master