Utilizing Version Control Management in WordPress
It used to be that I was very reluctant to use Git during my development; I though thtat I don’t need Git and can find no convincing reason to use it — that is, until the codes went haywire causing me to have to revert to the previous version. In cases like this, Git is extremely useful.
Git is a Version Control Management system that records revisions. Git can also be used as a backup plan, as you can revert files in case of a major screw up.
If you work on WordPress, you know that changes made within WordPress are irreversible. Once you have clicked the Save, Install, and Update buttons, it is hard to revert back to the previous state. Git would be real handy in a case like this.
Now there is a WordPress plugin called VersionPress, which combines Git with the familiar interface of WordPress. This plugin archives the changes and updates made in a WordPress website with Git, allowing you to undo a change or undo them back to the initial state. Let’s take a look how this plugin works.
Recommended Reading: WordPress Monitoring And Tracking With Stream
VersionPress ships in the form of a WordPress plugin; so you can switch the functionality on and off immediately with a click. Upon activating the plugin, you will find a new menu named VersionPress. This is where VersionPress records historical activities that happened in the website.
But, before it is fully functional, we need to initiate VersionPress to create the Git repository for the website.
Press the Initialize button.
VersionPress runs silently behind the scenes recording website activities such as creating a new post or page, installing a new plugin, posting comments, and configuring the website settings in the plugin screen, as shown below.
The recorded item shows the date when the activity occurs, the Git ID number of the record, the message or description of the activity.
Undo the Changes
As mentioned, VersionPress does not only record activities. Since VersionPression utilizes Git, it is also possible for you to revert back at some previous points.
Shown in the screenshot above, we already have several recorded items. On each of the recorded activites you will see two links, Undo This and Revert to This. Now, just in case, we want to revert back to the very beginning of the website state, we simply click the Revert to This at the last recorded item. VersionPress will bring you back there.
In addition, you can utilize VersionPress as a backup tool as well. What makes VersionPress backup different is that the backup file size could be much smaller compared to the traditional methods. A traditional backup tool will backup all the database in a particular timeframe – monthly, weekly, daily – and it will backup all the things even the same data that already has been backed up previously.
Git works by creating the backup only in logical change, not within a fixed timeframe. VersionPress is able to produce smaller backup sizes.
Read also: WordPress Database And Files Backup Solutions ‐ Best Of
Overall, VersionPress is a really creative way of Git use. From a developer’s point of view, VersionPress could be a very handy tool for website testing. At the time of the writing, however, VersionPress is in Alpha stage – in other word, it’s not ready for public testing yet (so, stay tuned!). The plugin will be released under GPL license, which is the same license used for WordPress.