title: Using Git branches to maintain subdomains of a website
body: <p>I am not an expert in Git, but I have seen this done before (I just didn't know the actual implementation behind it).</p>
  
  <p>I have my main website at www.foobar.com but I want to have a testing subdomain at beta.foobar.com (or if that's too complicated, a testing dir at foobar.com/beta)</p>
  
  <p>Is there a way to have 2 branches in my Git repo that manage the main website and a subdomain so that I can do all my testing in beta, and when I find my code satisfactory, I can simply merge beta in the master branch?</p>
  
  <p>If I am thinking about this problem the wrong way, please feel free to propose an alternative. Thanks!</p>