title: GIT - Remove old reflog entries
body: <p>After a lot of rebasing a repository to our latest needs our reflog is full of commits and orphan branches. We reached the final state of our reorganization.</p>
  
  <p>While there're branches and commits left with a lot of binary data the repository grew multiple times of its origin size we decided to purge all the old reflog entries and data.</p>
  
  <p>I was digging in the manual but didn't get much smarter experimenting with <a href="https://git-scm.com/docs/git-reflog#git-reflog---expirelttimegt" rel="noreferrer">git-reflog expire</a></p>
  
  <p>This is an example of the log (shortened)</p>
  
  <pre><code>-&gt; &lt;sha1&gt; [development] ...
  | &lt;sha1&gt; ...
  | &lt;sha1&gt; ...
  | &lt;sha1&gt; ...
  | &lt;sha1&gt; ...
  | &lt;sha1&gt; ...
  | &lt;sha1&gt; ...
  | &lt;sha1&gt; ...
  -&gt; &lt;sha1&gt; [master] ...
  -&gt; &lt;sha1-old&gt; ...
  | &lt;sha1-old&gt; ...
  | &lt;sha1-old&gt; ...
  | &lt;sha1-old&gt; ...
  | &lt;sha1-old&gt; ...
  | &lt;sha1-old&gt; ...
  | &lt;sha1-old&gt; ...
  | &lt;sha1-old&gt; ...
  -&gt; &lt;sha1-old&gt; ...
  </code></pre>
  
  <p>As you can see below the master branch there is the old commits / branches stating the repository before the rebase.</p>
  
  <p>We expect to clear the reflog to have the repository look like</p>
  
  <pre><code>-&gt; &lt;sha1&gt; [development] ...
  | &lt;sha1&gt; ...
  | &lt;sha1&gt; ...
  | &lt;sha1&gt; ...
  | &lt;sha1&gt; ...
  | &lt;sha1&gt; ...
  | &lt;sha1&gt; ...
  | &lt;sha1&gt; ...
  -&gt; &lt;sha1&gt; [master] ...
  </code></pre>
  
  <p>In order we expect to reduce the disk space used by the repository.</p>
  
  <p>How can I accomlish that?</p>
  
  <hr>
  
  <h2>Edit (2019-03-02 12:20)</h2>
  
  <p>Please do not mention to delete and re-clone the repository. This is not what I'm looking for.</p>
  
  <hr>
  
  <h2>Edit (2019-03-02 12:30)</h2>
  
  <p>What I tried so far but what not worked</p>
  
  <pre><code>git reflog expire --expire=all
  </code></pre>
  
  <p>Nothing happened so I tried to be clever and invoked the garbage collector</p>
  
  <pre><code>git gc --aggressive
  </code></pre>
  
  <p>But bogus.</p>