title: On git pull, "unable to resolve reference" and "Undefined error: 0"
body: <p>My morning started with <code>git pull</code>, just like any other morning:</p>
  
  <pre><code>$ git pull
  error: unable to resolve reference refs/remotes/origin/card-declined: Undefined error: 0
  From github.com:instaedu/instaedu
   ! [new branch]      card-declined -&gt; origin/card-declined  (unable to update local ref)
  </code></pre>
  
  <p>(FYI, "card-declined" is a branch I pushed to GitHub just last night, and hasn't had any activity since then.)</p>
  
  <p>I've never seen that error before, so I looked it up and found this question: <a href="https://stackoverflow.com/q/2998832/52263">git pull fails “unalble to resolve reference” “unable to update local ref”</a>. The top-voted answer there says to try running <code>git gc --prune=now</code>, so I did that:</p>
  
  <pre><code>$ git gc --prune=now
  error: bad ref for refs/remotes/origin/card-declined
  error: bad ref for refs/remotes/origin/card-declined
  fatal: loose object b28488de1ef3f6887eef99c0316a654d1803e6af (stored in .git/objects/b2/8488de1ef3f6887eef99c0316a654d1803e6af) is corrupt
  error: failed to run repack
  </code></pre>
  
  <p>It didn't seem to fix anything, though now I see that something seems to have been corrupted since yesterday.</p>
  
  <p>Any idea how to resolve this?</p>