title: Git Workflow for WordPress project
body: <h1>The Problem</h1>
  <p>Setting up a Git workflow for a WordPress site, with the following branches:</p>
  <ul>
  <li><code>master</code> (uses stable release of WordPress)</li>
  <li><code>production</code> (live site)</li>
  <li><code>bleeding</code> (uses most recent WordPress commit available on GitHub)</li>
  </ul>
  <p>with the following remotes:</p>
  <ul>
  <li><code>bitbucket</code> (private)</li>
  <li><code>wpe-staging</code></li>
  <li><code>wpe-production</code></li>
  </ul>
  <p>Developing and testing the site's theme and plugins on the upcoming version of WordPress is the goal, but I don't want to overly complicate my current workflow.</p>
  <h1>Background</h1>
  <p>Current site's repo has the following branches:</p>
  <ul>
  <li><code>master</code> (stable release of WP)</li>
  <li><code>production</code> (live site)</li>
  </ul>
  <p>and the same remotes as above.</p>
  <p>My current workflow works great. I can develop new features on my local stable release of WordPress (<code>master</code> branch), push <code>master</code> branch to <code>wpe-staging</code>, confirm things work in that environment, then merge <code>master</code> branch into <code>production</code> branch, and push to <code>wpe-production</code> remote. This allows me to make quick changes to the production site if I'm mobile, and keep work I've been doing locally away from production.</p>
  <p>Site is being hosted on WP Engine, which has Git pushing: <code>staging</code> and <code>production</code> branches and remotes refer to their respective code and URL on WP Engine hosting. All branches use the recommended <code>.gitignore</code> file, available here: <a href="https://wpengine.com/wp-content/uploads/2013/10/recommended-gitignore-no-wp.txt" rel="nofollow noreferrer">https://wpengine.com/wp-content/uploads/2013/10/recommended-gitignore-no-wp.txt</a></p>
  <p>I need to be able to track the entire WP install, as there are files in the root directory of WP that are tracked, committed, and being pushed.</p>
  <h1>What I've Tried</h1>
  <ul>
  <li>separate repository of <code>wp-content</code> directory (<code>repo-wpcontent</code>) added as submodule to <code>repo-project</code>: this seems like it would work, but seems messy with submods within a submod (plugins)</li>
  <li>separate repository of theme (<code>repo-theme</code>) directory added as submodule to <code>repo-project</code>: this seems even simpler than the above, but I'm nervous about tracking plugins and the theme in separate repos (again, seems messy)</li>
  </ul>
  <h2>Names</h2>
  <ul>
  <li><code>repo-project</code>: repo of the full WordPress directory</li>
  <li><code>repo-wpcontent</code>: repo of the <code>wp-content</code> directory</li>
  <li><code>repo-theme</code>: repo of the single WordPress theme being developed and tested</li>
  </ul>
  <h1>The Question</h1>
  <p>Based on your experience and knowledge, what is the best setup for me to be able to test the theme and plugins installed on both the stable and bleeding edge versions of WordPress, with the ability to edit code within one and pass those changes over to the other? I'm not crazy about having all the commits for the WordPress development mixed in with my project commits, but understand if that's unavoidable.</p>
  <h2>Thank you for your help.</h2>
  <p><strong>Update:</strong> I've now (seemingly) created a repo that works; I've created the following branches:</p>
  <ul>
  <li><code>theme</code>: tracks the theme only</li>
  <li><code>master</code>: tracks the WordPress install (core files excluded), with <code>theme</code> branch added as a submodule (pushes to <code>wpe-staging</code> remote)</li>
  <li><code>production</code>: tracks the WordPress install (core files excluded), with <code>theme</code> branch added as a submodule (pushes to <code>wpe-production</code> remote)</li>
  <li><code>stable</code>: stable version of WordPress with core files tracked, with <code>theme</code> branch added as a submodule</li>
  <li><code>bleeding</code>: most recent version of WordPress with core files tracked, with <code>theme</code> branch added as a submodule</li>
  </ul>
  <p>Since <code>theme</code> is added as a submodule to all branches, any changes I make in a branch can be passed to all branches. This is simpler (to me) than having a completely separate repository to track the theme.</p>
  <p>Is this a proper way to accomplish my goal, one that can last without any conflicts, or am I asking for trouble?</p>