Why do a few resources suggest excluding the WordPress install from a Git repository?

While switching a WordPress site onto Git I looked for a .gitignore template. But I stumbled upon a reoccurring theme.

Fact: you don’t want WordPress core files, or your server-specific configuration files etc., in your project’s repository. You just don’t. – Joe Bartlett

Read More

And the recommended GitHub .gitignore for WordPress excludes all wp-*.php files. WordPress.gitignore.

Why is this recommended? Surely I’d want as many core files to be included as possible, otherwise I have to install WordPress on every server I deploy to.

If context helps, I’m deploying it to a load balanced network with two application servers and two database servers.

Related posts

Leave a Reply

2 comments

  1. The only thing I keep in a repository is the theme, never any core WordPress files. In the readmes I keep track of what versions it works with.

    It’s probably not recommended to help discourage modifying the core files.

    Another idea is to keep WordPress as a clean git repo with your themes as submodules, that way you can upgrade/rollback WordPress separate from your themes. This is also how I maintain sites that use frameworks.