title: Get branche names of git submodules in another directory
body: <p>I have checked out a project that includes some submodules.</p>
  
  <p>First I checked out my <code>project</code> and then the <code>submodules</code>:</p>
  
  <pre><code>git clone git@my-gitlab-server:namespace/project.git
  </code></pre>
  
  <p>Initiatiated the submodules for that <code>branch</code> with the latest:</p>
  
  <pre><code>git submodule update --init --recursive
  </code></pre>
  
  <p>Then I checked out the specific branch that includes the submodules. I just want to get the <strong>branch</strong> name of each sumbodule.</p>
  
  <p><strong>But</strong>:</p>
  
  <pre><code>$ git --git-dir path/to/my/submodule rev-parse --abbrev-ref HEAD
  fatal: not a git repository: 'path/to/my/submodule'
  
  
  $ cd  path/to/my/submodule 
  $ (detached*)$ git branch
  * (HEAD detached at 24bbc55)
    develop
  </code></pre>
  
  <p>Why the first command shows that it is not a git submodule? (while it is)
  The checkout is done from a specific branch ('develop') of the submodule. How can I get the actual branch name (and not the git <code>sha</code>?)</p>