title: How can I show all the branches in a repository?
body: <p>I have a Git repository. How can I show all its branches?</p>
  
  <p>Are the following two commands supposed to show all the branches? If yes, why do they not show branch <code>master</code>? I was under the impression that the repository doesn't have branch <code>master</code>, when asking <a href="https://stackoverflow.com/questions/54160690/will-pushing-a-new-branch-to-another-repository-create-an-upstream-branch-and-re">https://stackoverflow.com/questions/54160690/will-pushing-a-new-branch-to-another-repository-create-an-upstream-branch-and-re</a>.</p>
  
  <pre><code>$ git branch -a
    mongodbutils
  
  $ git show-branch
  [mongodbutils] mongodbutils
  
  $ ls .git/refs/heads/
  mongodbutils
  </code></pre>
  
  <p>Why does the following command mention branch <code>master</code>?</p>
  
  <pre><code>$ git show
  fatal: your current branch 'master' does not have any commits yet
  </code></pre>
  
  <p>How can I show all the branches (including <code>master</code> in this case) in a repository? I think it is important, or else, I will have the same false impression.</p>
  
  <p>Note: the repository was created by <code>git init</code> an empty directory, and then I <code>git push</code> a branch <code>mongodbutils</code> from another branch into this branch.</p>