2

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.

2 Answers 2

4

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 a define() to simulate my path.

2
  • Thanks for your answer Jan. This was the direction I was leaning as well, especially since so many of the themes I develop for clients rely on specific plugins. Jan 13, 2011 at 18:44
  • Over time I'd like to reiterate that I think this is still the best way to go. Sure it's a little bit bulky when updating WP core and plugins, but important when working in a distributed team. May 20, 2012 at 18:13
2

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.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.