title: Why has Git allowed me to create two branches with the same name?
body: <p>I'm still relatively new to Git and I have made a bit of a mess of my repository. I'm hoping there is a way to fix it without re-cloning. </p>
  
  <p>I have a repository which I have cloned from Github. The repository has several branches. I worked on the master branch for a while but then needed to switch to one of the other branches.</p>
  
  <p>So, I had:</p>
  
  <pre><code>$ git branch --all
  * master
    remotes/origin/abc
    remotes/origin/def
    remotes/origin/HEAD -&gt; origin/master
    remotes/origin/ghi
  </code></pre>
  
  <p><strong>Problem:</strong> I wanted to switch to the 'abc' branch but instead of doing <code>git checkout remotes/origin/abc</code> I accidentally did <code>git branch remotes/origin/abc</code> which leaves me with the following:</p>
  
  <pre><code>$ git branch --all
  * master
    remotes/origin/abc
    remotes/origin/abc
    remotes/origin/def
    remotes/origin/HEAD -&gt; origin/master
    remotes/origin/ghi
  </code></pre>
  
  <p><strong>My questions are:</strong></p>
  
  <ul>
  <li>Why on Earth does Git allow you to create two branches with the same
  name? </li>
  <li>How do I identify which is the real remotes/origin/abc branch?</li>
  <li>How do I remove the unwanted remotes/origin/abc that I created by
  accident?</li>
  </ul>
  
  <p>Any help much appreciated.</p>