Automatic git version control and deployment for your plugins and themes integrated into wp-admin.
== About the makers ==
This plugin was developed by the crafty people at Presslabs—the Smart Managed WordPress Hosting Platform. Here we bring high-performance hosting and business intelligence for WordPress sites. In our spare time, we contribute to the global open-source community with our code.
We’ve built Gitium back in 2013 to provide our clients a more simple and error-free method to integrate a new git version control into their code management flow.
== What is Gitium? ==
This plugin enables continuous deployment for WordPress, integrating with tools such as Github, Bitbucket or Travis-CI. Theme or plugin updates, installs and removals are all automatically versioned. Ninja code edits from the WordPress editor are also tracked by the version control system.
== Why is Gitium? ==
Gitium is designed with responsible development environments in mind, allowing staging and production to follow different branches of the same repository. You can also deploy code by simply using git push.
Gitium requires git command line tool with a minimum version of 1.7 installed on the server and the proc_open PHP function enabled.
== Gitium features: ==
-preserves the WordPress behavior
-accountability for code changes
-safe code storage—gets all code edits in Git
== Development ==
For more details about Gitium, head here: http://docs.presslabs.com/gitium/usage/
== Receiving is nicer when giving ==
We’ve built this to make our lives easier and we’re happy to do that for other developers, too. We’d really appreciate it if you could contribute with code, tests, documentation or just share your experience with Gitium.
Development of Gitium happens at http://github.com/PressLabs/gitium
Issues are tracked at http://github.com/PressLabs/gitium/issues
This WordPress plugin can be found at https://wordpress.org/plugins/gitium/
After activation, go to the Gitium settings in your WordPress admin area.
Copy the Public Key that Gitium has generated for you from the Key Pair field.
In your repository manager of choice (GitHub, GitLab, or Bitbucket), go to the settings page and find the “Deploy keys” (or similar) section. There you will need to add the Public Key you’ve copied from Gitium. This will grant Gitium access to your repository. Make sure to allow write access as well. Also make sure that you copy the entire key from gitium.
Now go back to your main repository page and copy the SSH URL to your repo. Paste this URL in Gitium and press the “Fetch” button.
A “Repository initialized successfully” message will show up. This means that your repository has been populated with the current code of your website and it is ready to start working with Gitium.
- Initial Commit
Once connected, Gitium will automatically commit your existing WordPress theme and plugins to the connected repository.
This initial commit serves as the baseline for your site’s code.
- Making Changes
Make changes to your WordPress site’s code (themes, plugins) as needed.
Gitium will automatically commit these changes to your Git repository.
Using the webhook provided by Gitium, it will also automatically deploy the changes from the repository to your WordPress site.
- Webook Configuration
Gitium uses the webhook to automatically deploy remote changes to your server. To configure it follow these steps:
1. Go to your WordPress website and go to your Gitium Settings page;
2. Copy the full Webhook URL that Gitium provides;
3. In your Git Manager settings, go to Webhook section, add a new webhook and paste the webhook URL you have copied from Gitium.
4. Press Add, no settings changes needed. The webook simply needs a ping, nothing more. The security key is already embedded in the final URL Gitium has generated for you.
Now when you push to your repo, this webhook will automatically pull the changes to your remote server and deploy them.
If you encounter this kind of error you can try to fix it by setting the proper username of the .git directory.
Example: chown -R www-data:www-data .git
= Is this plugin considered stable? =
Yes, we consider the plugin stable after extensive usage in production environments at Presslabs, with hundreds of users and powering sites with hundreds of millions of pageviews per month.
= What will happen in case of conflicts? =
The behavior in case of conflicts is to overwrite the changes on the `origin` repository with the local changes (ie. local modifications take precedence over remote ones).
= How to deploy automatically after a push? =
You can ping the webhook url after a push to automatically deploy the new code. The webhook url can be found under `Gitium` menu, `Settings` section. This url also plays well with Github or Bitbucket webhooks.
= Does it works on multi site setups? =
Gitium does not support multisite setups at the moment.
= Where do I report security bugs found in this plugin? =
Please report security bugs found in the source code of the Gitium plugin through the [Patchstack Vulnerability Disclosure Program](https://patchstack.com/database/vdp/gitium). The Patchstack team will assist you with verification, CVE assignment, and notify the developers of this plugin.