title: List remote branches - git branch -a vs git ls-remote --heads origin
body: <p>Following <a href="https://tecadmin.net/list-all-remote-branches-in-git/#" rel="noreferrer">post</a> commands should produce the same output with regard to remote branches, however </p>
  
  <pre><code>git fetch
  git branch -a 
  </code></pre>
  
  <p>shows remote branches that are not visible while executing </p>
  
  <pre><code>git ls-remote --heads origin
  </code></pre>
  
  <p>What is the reason of this behavior?</p>
  
  <p>[clarification]</p>
  
  <pre><code>(TA216441) $ git pull
  Your configuration specifies to merge with the ref 'refs/heads/TA216441'
  from the remote, but no such ref was fetched.
  
  (TA216441) $ git fetch
  (TA216441) $ git branch -a
  * TA216441
    TA216442
    master
    remotes/origin/HEAD -&gt; origin/master
    remotes/origin/TA212425
    remotes/origin/TA216441
    remotes/origin/TA219346
    remotes/origin/TA220305
    remotes/origin/TA223738
    remotes/origin/master
  
  (TA216441) $ git ls-remote --heads origin
    hash-1 refs/heads/DE18756_2
    hash-2 refs/heads/TA212425
    hash-2 refs/heads/TA219346
    hash-3 refs/heads/TA220305
    hash-4 refs/heads/master
  </code></pre>