title: Git submodule update overwritten
body: <p>I'm working on a git project with several people and we have included an external library as a git submodule. We share a common remote that we regularly push to and pull from.</p>
  
  <p>Since we first added this submodule there were some changes in it, so I did a <code>git submodule update --remote</code> to update it to the newest version. That worked for me and I pushed this to our shared remote. The file at the location of the submodule where the reference to the commit is stored, has changed:</p>
  
  <pre><code>-Subproject commit &lt;old-commit-hash&gt;
  +Subproject commit &lt;new-commit-hash&gt;
  </code></pre>
  
  <p>When my colleagues are pulling changes from our shared remote, they also receive the changed submodule, however this seems to be different from a change in a regular file, since it does not overwrite the old version (what I would expect), but it appears as change when they run <code>git status</code>:</p>
  
  <pre><code>Changes not staged for commit:
      modified:   src/submodule (new commits)
  </code></pre>
  
  <p>So the file underneath changed (to the new revision that I pushed), but somehow git thinks that the <strong>local version</strong> of my colleague is newer. However, this is actually the old one, pointing to the previous revision that my colleagues still have.</p>
  
  <p>Now, I like my colleagues, but sometimes they don't really pay attention and all they do is <code>git add .</code> or <code>git commit -a</code> which includes <em>all</em> changes and of course overwrites the changes to the submodule with the reference to the old submodule commit.</p>
  
  <p>Is there a way to enforce this submodule update for all people that pull from this remote? Can this submodule reference file be treated like a normal file that is just updated normally?
  Or do I have to tell my colleagues to pay more attention and do a <code>git submodule update</code> from time to time?</p>
  
  <p>I hope my question is clear. If not, please ask and I'll try to clarify.</p>