I’ve currently been creating my Git repositories at the root level for each of my WordPress installations. Git of course then notices any core updates, plugins, and uploads. I’m considering just tracking the theme I’m working on or perhaps the entire themes directory.
I’d like to hear from other WordPress developers as to what are their preferred version control practices.
If I’m working on whole project for a client (WP install + custom theme + plugins), I put everything in one repository. My thinking is that I created one “solution” based on WP + some existing plugins + my added code, and thus I should track it as one solution. When WP or a plugin is updated I need to test it on a dev and/or staging environment anyway, so it’s better to know the version control status of the whole project.
If I’m working on one plugin, I put it outside the WP directory and use symlinks from multiple installations to simplify testing. The repository is then only the plugin. The only problem there is that
__FILE__
won’t work, so I work with adefine()
to simulate my path.Iâm using one Git repository per project: One for each theme, plugin, importer etc. If you donât want so many projects, use gitignore to avoid the tracking of native WP files.