I have a client site that’s under version control using Git. The single repository is at the WordPress root level, but it is set to ignore everything except for theme and plugin files. I did some research into best practices and found some content on submodules, which I might try next time, but at the moment, I’m wondering if there’s a way to achieve both of the following:
- Keep the Git repository structured as is at the WordPress root but effectively only use it to version control theme and plugins in a single repository.
- Enable automatic WordPress core updates and get around this error:
This site appears to be under version control. Automatic updates are disabled.
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
Adding this filter in a must-use plugin or functions.php will allow automatic updates even if the site is under version control:
add_filter( 'automatic_updates_is_vcs_checkout', '__return_false', 1 );
From https://developer.wordpress.org/reference/hooks/automatic_updates_is_vcs_checkout/
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0
