How to fix "warning: ignoring ref with broken name" in git?
<p>I'm working on OSX. In a particular repo, whenever I tab to autocomplete after typing a git command:</p>

<pre><code>$ git diff [clicks tab...]
</code></pre>

<p>I now see a huge number of warnings:</p>

<pre><code>warning: ignoring ref with broken name refs/Icon
warning: ignoring ref with broken name refs/heads/Icon
warning: ignoring ref with broken name refs/remotes/Icon
warning: ignoring ref with broken name refs/remotes/origin/Icon
warning: ignoring ref with broken name refs/tags/Icon
</code></pre>

<p>It's really annoying, and it means that I can't see the filenames I want to see.</p>

<p>How can I remove or suppress these warnings?</p>

<p>I have an entry for <code>Icon?</code> in my <code>gitignore</code> file. There is an <code>Icon?</code> file in the local directory. </p>

<p>For all the trigger-happy people about to click "duplicate": I've searched for other answers, I <a href="https://stackoverflow.com/questions/28894135/removing-broken-names-in-git-dropbox-conflicted-copy">found this</a> but I'm not sure how it relates to my situation. It may be that the underlying cause is the same, but it would benefit me and others to have an explanation of how to fix this problem. </p>