O'Neill is a template for managing WordPress development projects with Git and Composer.
Version control your code through Git but without including WordPress or any dependent plugins and themes, leaving that to Composer. The basic premise is thus;
- Your composer.json, custom plugins/themes are tracked by Git
- Setting up your WordPress install, and installing required plugins, are handled by Composer
- Clone or download this repo
- Get rid of the .git directory (if you cloned) to remove the template's history
- Rename gitignore to .gitignore
- Open up .gitignore and uncomment lines 6 and 10-15
- Remove the example plugins from composer.json, if you want to (DON'T remove WordPress)
git init
git add *
git commit -m "First commit"
composer install
to install WordPress and any dependent plugins/themes- Open up secrets/environment.php and check which environment you want to set
- Open up secrets/keys.php and provide new salts and database credentials
- Develop your project, adding your custom plugins/themes as relevant
- Update .gitignore to make sure that your custom code isn't ignored
Once you've got a working project, deploying it elsewhere should be as easy as;
git clone git@gitremote.com:your-project.git your-project
cd your-project
composer install
Included in this template's composer.json are two excellent plugins from @johnbillion to demonstrate how you can include your dependent plugins.
What is a developer to do when he can't think of a name for his little project? Yes, that's right, leverage his love of sci-fi franchise Stargate. O'Neill is named after Colonel Jack O'Neill of SG-1, because geek.
Kudos to the Roots primer on Composer & WordPress for the inspiration.