I’m struggling to come up with a good workflow for using git on my complex WordPress projects. I’m wondering if people can recommend a workflow that tends to work well in that situation.
Here’s the situation I have, and the problems I’ve run into.
The situation: WordPress installation, with customized configuration files for WordPress and for the server, two or more WordPress themes from multiple developers and 20-25 plugins from multiple developers.
Problems:
- I thought about just creating repos for individual plugins and themes, since WordPress handles its own updates. That would be a lot easier to manage, but I still need to track the project as a whole (which plugins are used, WordPress config files, server config files, Google verification files, favicons and other resources that are not part of a plugin or theme), and I want an easy way to clone or deploy the whole project onto a new server.
- Not all plugins have a public git repo, so I either have to add that code to my own repo or ignore the directories for those plugins.
If I ignore plugins without a repo that still the problem of that code not being in version control. That makes it difficult to clone, deploy or track my own changes to it.
What is the best workflow for using git with large scale WordPress projects?
I have 1 repo for every project. This allows me to track changes on both sides local and server. You can also use git hooks / cron, etc.. to keep the sever in sync or a build process.
When I do themes, its generally project specific, so its just done in the project repo.
My plugins I maintain outside in a separate repo specific to that plugin.
If its a client that I maintain, then everything is handled by Git and autoupdates are disabled. My favorite benefit from this is one command git status lets me know what changed with the sites files + the fact that its all backed up to the remote and my local and tracked.
You can also do full deploys with Vagrant, PuPHPet and/or a variation of https://github.com/10up/varying-vagrant-vagrants
I have been optimizing my own builds, starting to work with Composer, varying vagrant vagrants, Grunt and GitLab for private repo management, hopefully to save time with the entire process.
In the end its going to depend on a lot of variables,