title: Git submodules workflow issues
body: <p>We are having a lot of problems recently with our Git repositories. We are users of git submodules for a total of 4 shared repositories between our applications.</p>
  
  <p>For example, repository 'website' has a total of 3 submodules.</p>
  
  <pre><code>[submodule "vendor/api"]
      path = vendor/api
      url = git@your.cool.domain.com:api
  [submodule "vendor/auth"]
      path = vendor/auth
      url = git@your.cool.domain.com:auth
  [submodule "vendor/tools"]
      path = vendor/tools
      url = git@your.cool.domain.com:tools
  </code></pre>
  
  <p>We have checked out correctly our main repository 'website'. Now one of my co-workers have done a push, then I <code>git pull; git status</code>:</p>
  
  <pre><code># On branch master
  # Changed but not updated:
  #   (use "git add &lt;file&gt;..." to update what will be committed)
  #   (use "git checkout -- &lt;file&gt;..." to discard changes in working directory)
  #
  #   modified:   vendor/api (new commits)
  #   modified:   vendor/auth (new commits)
  #   modified:   vendor/tools (new commits)
  #
  no changes added to commit (use "git add" and/or "git commit -a")
  
  mcfly@future:~/projects/website$ git diff
  
  diff --git a/vendor/api b/vendor/api
  index 41795fc..b582d80 160000
  --- a/vendor/api
  +++ b/vendor/api
  @@ -1 +1 @@
  -Subproject commit 41795fc4dde464d633f4c0f01eebb6ab1ad55582
  +Subproject commit b582d802419b0ee7bc3959e7623fec0b94680269
  diff --git a/vendor/auth b/vendor/auth
  index a00369b..4599a71 160000
  --- a/vendor/auth
  +++ b/vendor/auth
  @@ -1 +1 @@
  -Subproject commit a00369bf29f14c761ce71f7b95aa1e9c107fb2ed
  +Subproject commit 4599a7179c9b7ca4afa610a15ffa4a8fc6ebf911
  diff --git a/vendor/tools b/vendor/tools
  index f966744..c678cf6 160000
  --- a/vendor/tools
  +++ b/vendor/tools
  @@ -1 +1 @@
  -Subproject commit f966744359510656b492ae3091288664cdb1410b
  +Subproject commit c678cf6f599fc450e312f0459ffe74e593f5890f
  </code></pre>
  
  <p>What's the problem with that <code>git diff</code>? The problem is that the new commits for each submodule are OLDER than the ones that will be overwritten. That's not what we want because on the repository is pointing correctly to <code>41795fc4dde464d633f4c0f01eebb6ab1ad55582</code>, <code>a00369bf29f14c761ce71f7b95aa1e9c107fb2ed</code> and <code>f966744359510656b492ae3091288664cdb1410b</code> and if we add this modifications to our next commit we will probably brake the things. I don't know why its getting the oldest revision and not the newest.</p>
  
  <p>I have tried to solve this by myself but with no success:</p>
  
  <pre><code>mcfly@future:~/projects/website$ git pull; git submodule foreach git pull
  </code></pre>
  
  <p>Doing the last command it's not correct because we will probably update the pointer of 'website' to the newest of each submodule and we don't want this. We want to preserve the correct revision that it's on the repository.</p>
  
  <p>One of the things that I've to explain that we usually work inside this submodules, for example:</p>
  
  <pre><code>mcfly@future:~/projects/website$ cd vendor/api
  mcfly@future:~/projects/website/vendor/api$ git checkout master
  mcfly@future:~/projects/website/vendor/api$ echo "lorem ipsum" &gt;&gt; example.file
  mcfly@future:~/projects/website/vendor/api$ git add example.file; git push
  </code></pre>
  
  <p>When we do a <code>git submodule update</code> the 'master' branch is lost on every submodule.</p>
  
  <p>Finally, what si the correct way of doing the <code>push</code>, <code>pull</code> and working with submodules and not having all this problems?</p>
  
  <p>Thank you in advance</p>