Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to incorporate WordPress automatic updates with Git as version control?

Tags:

People also ask

How do I make WordPress update automatically?

Under the 'Automatic updates' section, click on the 'Custom' option. After that, click on the 'Enable Major Releases' button under the 'Major WordPress Releases' section. The plugin will automatically store your settings and enable the major WordPress releases to be automatically updated.

Can you use Git with WordPress?

As the name suggests, WordPress GitHub Sync enables you to sync your WordPress site with any Git host. It offers standard Git functionality, recording all changes to your site along with the users who made them. However, it also enables external users to submit proposed changes through GitHub.

Does WordPress have automatic updates?

Update Types Automatic background updates were introduced in WordPress 3.7 in an effort to promote better security, and to streamline the update experience overall. By default, automatic updates of WordPress are enabled on most sites. In special cases, plugins and themes may be automatically updated as well.

Should I enable auto-updates for WordPress plugins?

While the latest update of WordPress can update your plugins automatically, we recommend that you turn off auto-updates for all/selected plugins and use Easy Updates Manager instead. Easy Updates Manager currently helps more than 300,000 WordPress users automatically keep their sites up to date and bug-free.


I am trying to find a solution to a very difficult task: properly version controlling WordPress, specifically when working with automatic updates.

WordPress allows a lot of simplicity by allowing users to update WordPress core files, themes and plugins by simply clicking a button. But what happens when you have that website under version control with something like Git? As soon as we click that "Update Now" button, our Git repo will be out of sync and therefore defeats the purpose of creating a Git repo in the first place.

I have been looking into ways to get around this issue and all I was able to find was different ways to structure the Wordpress installation by breaking up components into Git submodules. One of the most popular example is the WordPress-Skeleton template.

Although this works to version control each module / component of WordPress, it still does not allow the user to be able to use the automatic updates button from within WordPress, as that will update the files in production but not commit those changes into your Git repo.

In an ideal world, we should be able to version control all the files in one repository and then when we click the "Update Now" button, it should update our Git repo with the modifications automatically. Does anyone know how this can be accomplished?

One of the things I was thinking was to create a plugin that would listen for update events and automatically commit changes as soon as that hook is triggered. Not sure if this is the best approach.

Please let me know if anyone has a better way I can accomplish this.