• Resolved scottsawyer

    (@scottsawyer)


    This is a general question about how to manage a WooCommerce site when the site is version controlled.

    Essentially, we have a parent repo, WordPress is a submodule, our theme is a submodule. WooCommerce is in the parent repo.

    WooCommerce periodically updates our single-product.php, most often just bumping the version number. This is constantly causing our production environment to have uncommitted changes.

    The only options that I can see are:

    1. Change file permissions so Woo can’t change the file ( probably a bad idea )
    2. Add single-product.php to the .gitignore. I don’t like this solution either, because we’ll never get the latest version sync’d with Dev and Staging.

    My question is, what is the recommended way to keep a production site clean ( meaning, no uncommitted changes ) considering that WooCommerce may, at any time, update a git managed theme?

    In my opinion, this is a bug. I am pretty sure WordPress can detect that a site is git managed, and disables auto-updates by default. This would be the preferred behavior. We do not want production files EVER changing on production with out going through the normal deployment process.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    To be honest, I’m quite confused by your setup. Why not just commit the whole site to a git repo? Or more common is to keep just the wp-contents folder version controlled.

    WooCommerce shouldn’t be changing things on your site automatically? Are you updating the plugin? You can override templates in a theme / child theme and that prevents a WC update from changing them (though you then need to do manual changes, so do this with caution and only when necessary) https://docs.woocommerce.com/document/template-structure/

Viewing 1 replies (of 1 total)
  • The topic ‘Managing a WooCommerce site with Git’ is closed to new replies.