title: Git: Working with two divergent branches
body: <p>I read numerous articles on this topic, but I'm still not sure how to proceed.</p>
  
  <p>I have an application that has grown over the past 15 years; until now, the source code has been managed using another source control system. I'm planning to migrate to Git and intend to use a branching model like the one described <a href="http://www.bitsnbites.eu/a-stable-mainline-branching-model-for-git/" rel="nofollow noreferrer">here</a>.</p>
  
  <p>These branches need to be migrated from our current system to Git:</p>
  
  <pre><code>Current system | Git
  ---------------------------
  Dev            | master
  v1             | release/v1
  </code></pre>
  
  <p>v1 is a legacy release that needs to be maintained for now but will be deprecated at some point. It is very different from Dev and will never be merged entirely. </p>
  
  <p>What I would like to do is:</p>
  
  <ul>
  <li>Initialize the repository</li>
  <li>Check in <code>Dev</code> code as <code>master</code></li>
  <li>Switch to branch <code>release/v1</code> and replace all files with the current <code>v1</code> files, then push them to the server</li>
  </ul>
  
  <p>Now comes the part that's unclear to me: I would like to be able to merge specific changes from <code>release/v1</code> to <code>master</code> in the future for parts of the application that are still similar enough, i.e. when fixing a bug in <code>v1</code>. To be able to do that, I need to do an initial upstream merge from <code>release/v1</code> to <code>master</code> where all differences are ignored, so <code>master</code> remains as it is and only changes after that point are taken into consideration.</p>
  
  <p>Would <code>git merge -Xtheirs</code> be the way to go in this situation?</p>
  
  <p>Thanks,
  Jan</p>
  
  <p>Edit:</p>
  
  <p>I think I may have found my solution - not sure if it's elegant, but it seems to result in the correct state:</p>
  
  <ul>
  <li>Create repo and check in files for <code>master</code></li>
  <li>Branch <code>release/v1</code></li>
  <li>Replace contents of <code>release/v1</code> with files from previous SCM</li>
  <li>Checkout <code>master</code></li>
  <li>merge with strategy <strong>ours</strong>: <code>git merge -s ours release/v1</code></li>
  </ul>