Is it better to create a Git repository at the root level or in the WordPress theme directory?

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.

Related posts

Leave a Reply

2 comments

  1. 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.