title: How to delete broken commits in git that has commit id but not readable
body: <p>I have a repo that when I run <code>git fsck --full</code>, I got a long list of broken commit ids:</p>
  <pre><code>Checking object directories: 100% (256/256), done.
  Checking objects: 100% (861/861), done.
  error: Could not read 0f514378e088c610cbeb8b047c63d4209736d1f9
  failed to parse commit 0f514378e088c610cbeb8b047c63d4209736d1f9 from object database for commit-graph
  error: Could not read 1e77fe5a6c4bec9bc9bd7ac5c00f2bbe98249b44
  failed to parse commit 1e77fe5a6c4bec9bc9bd7ac5c00f2bbe98249b44 from object database for commit-graph
  error: Could not read 2a86db8a8c83ac0fdb5050efa63b518fbeaf8146
  failed to parse commit 2a86db8a8c83ac0fdb5050efa63b518fbeaf8146 from object database for commit-graph
  error: Could not read 2d898d27a8858cfba7db93f79ada3bdca181758d
  failed to parse commit 2d898d27a8858cfba7db93f79ada3bdca181758d from object database for commit-graph
  ...
  error: Could not read fc80facb8f8bf3a5972c51b2e9ae5e63552db2f0
  failed to parse commit fc80facb8f8bf3a5972c51b2e9ae5e63552db2f0 from object database for commit-graph
  Verifying commits in commit graph: 100% (28/28), done.
  </code></pre>
  <p>I just could not figure out how to delete them. I tried <code>git gc</code>, <code>git prune</code>, none of them works...</p>
  <p>also I have a commit that can be shown as diff with <code>git show &lt;commit_id&gt;</code>, but when I run <code>git branch --contains &lt;commit_id&gt;</code> , no branch is found, so I believe that is a dangling commit, but again, I tried everything I found on google. None works.</p>
  <p>The commands I tried.</p>
  <pre><code>git prune --expire now
  git gc --prune=now
  git filter-branch --force --index-filter &quot;git rm --cached --ignore-unmatch filename --prune-empty --tag-name-filter cat -- --all&quot;
  ...
  
  </code></pre>