Some time ago, I have written an article about how to set up versioning for WordPress using git. I now came across an article by Newt Labs which have created an infographic about the justification for using git for WordPress. I think this infographic is quite insightful, so I will provide it below (with the kind permission of Newt Labs).
One thing which was of particular interest to me was that there was a handy list of alternatives to Revisr in the graphic. The alternatives are the following:
Personally I have only used Revisr, which worked fine for me. However, I am a bit concerned by their website greeting visitors with a warning about an expired SSL certificate. This should really have been fixed by now and is not building my trust in the tool.
WordPress is a powerful platform to just get a simple website up and running. Unfortunately, some things which are considered best practice in software development projects are a bit difficult to realize with WordPress. One of these things is versioning. Thankfully, there is a powerful plug in which enables versioning WordPress using a git repository: Revisr.
As of writing this, one is first greeted by an error message when visiting the Revisr website (something to do with SSL). It is safe to ignore this and to instruct your browser to show this website irrespective of the error message displayed (you won’t be giving any confidential information to this webiste, just browsing around).
In any case, you can download Revisr from WordPress with the following link:
Following the steps for setting it up:
- Go to your WordPress Admin console
- Install the plugin
- Activate it
- Reload WordPress Admin console
- Click on Revisr on the Sidebar
- Instruct it to create a new repository
That’s already it for setting up a local git repo that will enable some versioning. However, you can also use this plugin to backup your site and all versions to a remote git repository, for instance using BitBucket. The instructions for this come as follows (assuming you are using an Apache Web server):
- Login to your server using SSH with a user with sudo rights
- Execute the following
sudo ssh keygen
- Follow the prompts to create the key
- Execute the following (where /var/www is the root dir of your Apache server)
sudo cp -r /root/.ssh /var/www
sudo chown -R apache:apache /var/www/.ssh
- Create the file /var/www/.ssh/.htaccess and put in the following content (this is just a security measure)
Deny from all
- Grab the public key and save it somewhere
sudo cat /var/www/.ssh/id_rsa.pub
- Create a new account for BitBucket if you don’t have one already.
- Add a public SSH key for your account. Add the SSH key you saved earlier.
- Create a new repository. Grab the git SSH link for this repository.
- Go back to your WordPress Admin console and select the Revisr plugin from the sidebar
- Go to Settings / General. Set your username to git and define an email. Click Save
- Go to Settings / Remote. Set Remote URL to the SSH link for the repository you saved earlier. Click Save.
Now you can go back to the main Revisr page and start committing changes and pushing to the remote repository!