title: Git subtree merge, but keep local changes?
body: <p>There is a branch on a 3rd party repo that I want to add as a subdirectory of my repo. I want to be able to make changes to that 3rd party code, maintain those changes in my repo, and still be able to get updates that were made to the 3rd party repo. In essence, I'm trying to create an overlay.</p>
  
  <p>Following the guide <a href="http://git-scm.com/book/ch6-7.html" rel="noreferrer">here</a> for subtree merging (which describes exactly what I'm trying to accomplish), I've created a remote that points to that 3rd party repo, created a local branch that references the remote branch I want, done a pull on that branch, and used read-tree to copy the local branch's contents in to a subdirectory in master.</p>
  
  <p>I have committed and pushed changes (new files and edits to existing files) in this subdirectory to master. Changes have also been made to various files in the upstream branch. I've been able to pull the changes down to my branch. However, when I attempt to merge as follows,</p>
  
  <pre><code>git merge --squash -s subtree --no-commit &lt;my_branch&gt;
  </code></pre>
  
  <p>My local changes are overwritten by the changes upstream. The new files I created are removed and changes I've made to existing files are lost.</p>
  
  <p>Am I doing something wrong or is that the expected behaviour? How can I keep my changes and still merge in changes from upstream?</p>