Website maintenance via version management WordPress development with GitHub
GitHub is also suitable for developing WordPress sites, plug-ins and themes. However, both services must be connected to each other. Fortunately, this is easy to do – and offers a number of advantages.
Companies on the topic
Complete WordPress installations can be maintained locally and remotely via the detour of a GitHub repository.
WordPress is still the most popular open source CMS-and not without reason: There are countless plug-ins and themes that make setting up a WordPress site a breeze.
WordPress also offers enormous potential for developers: Due to its wide distribution, premium plug-ins and themes can be marketed and sold well on platforms such as Envato or via the WordPress plug-in system. This in turn can help companies or free web developers earn a small additional income-or even build the entire business model on WordPress.
Image gallery
WordPress with GitHub: A Powerful Team
The development of WordPress additions is of course possible with any text editor. However, just like with all other projects, the version management system GitHub is suitable for maintenance.
Of course, in order to develop meaningfully with GitHub for WordPress, it makes sense to connect both platforms together. Of course, this is possible in live operation, but it is much easier to set up a staging environment, either locally or on the server, with the help of which development can be smoothly, while the live site remains untouched at first.
Create Staging Site
A remote staging system can be quickly pulled out of the existing page with WP staging. The easiest way to set up a local staging environment for WordPress is with the WordPress stack from Bitnami: This is a local XAMPP web server, where WordPress is already preinstalled and can then be set up with a few simple steps.
Alternatively, XAMPP installs a flexible local LAMP / MAMP / WAMP server on Windows, Mac, and Linux systems where WordPress can be set up locally. On Windows and macOS, MAMP is also an alternative. After the transfer of files and database it can already start.
Connecting WordPress Staging and GitHub
The next step is to connect WordPress to Github. To do this, you must first create a GitHub repository for the new WordPress project on GitHub. Then, the repository can be cloned to the theme or plug-in folder of the local WordPress staging site using the GitHub app. This will connect the theme directly to the staging site on Github.
If the theme or plug-in is already developed enough to work, it can also be activated directly in the local WordPress installation. The development takes place within the theme or plug-in directory of WordPress, the changes are automatically transferred to GitHub on commit and push.
Transferring development to the live site
The subsequent development is “business as usual”: the theme or plug – in files can be easily edited and synchronized. If a development status is to be transferred to the live site on the web server, the repo can optionally be loaded as a ZIP and uploaded to WordPress.
It is easier, however, if Git is already installed on the web server: With its help, the repo can be easily accessed via command line with the command …
git clone https://github.com/{name}/{reponame}.git
… from the theme or plug – in directory to the live site. After going live, the theme or plug-in will also run on the live site with the current development status.
The further development takes place unaffected by this on the staging environment. To transfer the latest status to the live site, it is sufficient to run git pull from the plug-in or theme directory via command line. The update is then transferred.
Develop and test locally, go live quickly
Of course, with this approach, complete WordPress installations can also be maintained locally and remotely via the detour of a GitHub repository. To do this, the repo only needs to point to the main layer of the staging site. This has the advantage that changes to the theme’s system files are also reflected – ideal for developers who adapt existing solutions and do not create them themselves.
If you do not want to see your themes and plug-ins publicly on GitHub, you can of course also switch them privately. Overall, this GitHub workflow results in a solid development system that can quickly update the live site.
Regularly move the current state of the website to the local staging environment
In order to drag the current status of the WordPress installation, including databases, into the staging site, BlogVault offers itself: The paid plug-in pulls a complete backup of the respective status of the live site, including databases, and plays it automatically into the staging environment using its staging feature if desired.
Developers can access the current status of the site at any time to develop themes and plug-ins. By the way, you also get a reliable backup function by using BlogVault.
(ID: 47492144)