git and local wordpress: how to handle wordpress updates?

I would formulate your requirements like this:

  • repository should capture complete and precise state of site
  • updates should be tested locally and pushed to production
  • database update events should run in production reliably

Sticking with Git alone that would indeed mean that you need to install updates locally and commit them into repository.

As for database updates WordPress core itself versions database structure and checks for it on boot. If database is outdated upon visiting site’s admin you will be prompted to perform update. I think more busy sites often choose to override that behavior in favor of running it behind the scenes on demand instead.

This mostly leaves auditing specific plugins you use to check if they use custom database tables and such. It’s not that common among WP extensions, most of them get by with native WP data structures and APIs.

As for possible improvement I would recommend to look into Composer and handling WP core as dependency. That would remove the need to keep copy of whole WP core in your repo.

Leave a Comment