title: Git Submodules become detach on clone
body: <p>I am setting up a git-repository that will be used by 5-10 developers
  I have setup a few submodules within my main repository, but it seems they do not automatically track a branch upon recursive clone.
  The main problem is to avoid developers committing outside a branch (i.e. headless)</p>
  
  <p>I believe i have added the submodules the way other StackOverflow post suggest you should setup branch tracking. e.g. <a href="https://stackoverflow.com/questions/9189575/git-submodule-tracking-latest">git submodule tracking latest</a></p>
  
  <p>i use git 2.7.4 and add with the commands</p>
  
  <pre><code>git submodule add -b ${submodule_branch} ../../${submodule_repo_path}.git ${submodule_path}
  git submodule update --remote
  </code></pre>
  
  <p>When i call 'git branch' within one of the submodules it clearly show that i am on a branch.</p>
  
  <pre><code>git branch
  * master
  </code></pre>
  
  <p>I commit this change and push to the remote 'git push origin --mirror --force'</p>
  
  <p>The server is BitBucket v5.3.0</p>
  
  <p>When i clone with 'git clone --recursive' i get all the repo and the .gitmodules looks right, it mentions the branch</p>
  
  <pre><code>[submodule "some_app"]
  path = some_app
  url = ../../some_app.git
  branch = master
  </code></pre>
  
  <p>However within the submodule it looks like it is detached:</p>
  
  <pre><code>somepath/some_app ((487b858...))
  $ git branch
  git branch
  * (HEAD detached at 487b858)
    master
  </code></pre>
  
  <p>I can make a workaround by checking out the correct branch in each submodule, but i do not think it should be needed.</p>
  
  <p>i have also tried to call</p>
  
  <pre><code>git submodule update --remote
  </code></pre>
  
  <p>after cloning, but it did not help</p>
  
  <p>Is it normal practice that you must first checkout a branch when working with submodules?</p>