title: How do I set up test environment with git?
body: <p>I need the best git setup practice for situations like this:</p>
  
  <p><a href="https://i.stack.imgur.com/C3EXk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/C3EXk.png" alt="enter image description here"></a></p>
  
  <p>I am currently working on a Laravel project, let's call it <code>core</code> for now, which has two implementations (called <code>project_1</code>, <code>project_2</code>). The two implementations share the same <code>core</code>. The differences are the models, controllers, requests, routes, etc.</p>
  
  <p><strong>First attempt</strong></p>
  
  <p>I set 3 folders, one called <code>core</code>, one called <code>project_1</code>, one called <code>project_2</code>. The <code>core</code> only has the common files that shared in both projects. There are no models, controllers in <code>core</code>. Each time I make changes to core, I can easily push to either project. However, the problem is, since the <code>core</code> doesn't have any models, controllers..., I can't do any testings.</p>
  
  <p><strong>Second attempt</strong></p>
  
  <p>So later, I created a <code>test</code> project from <code>core</code>, with models, controllers copied from <code>project_2</code>. And add those files in <code>.git/info/exclude</code>, then <code>git rm --cached file</code> each of them. But problem is, when push or pull, those files are also deleted in <code>project_2</code>...</p>
  
  <p><strong>What I want to achieve</strong></p>
  
  <p>I would like a setup, that I can easily twist and test codes in <code>test</code> project, and then only push codes inside <code>core</code> to <code>project_1</code> and <code>project_2</code>.</p>