title: Cleaning git repository BFG Repo-Cleaner --- repo size is still large after I push
body: <p>I am trying to clean up my git repository with BFG repo cleaner. So I did:
  <code>
  git clone --mirror https://github.com/FourierFlows/FourierFlows.jl.git
  </code>
  used BFG, e.g.,
  <code>
  java -jar bfg-1.13.0.jar --delete-files 'twodturb*.png' FourierFlows.jl.git
  </code>
  and then 
  <code>
  cd FourierFlows.jl.git
  git reflog expire --expire=now --all &amp;&amp; git gc --prune=now --aggressive
  </code></p>
  
  <p>The repository is now much smaller (1.9MB compared to 880MB). But when I pushed back and tried later to <code>git clone --mirror</code> again I still got the repository having the size I started up with.</p>
  
  <pre><code>navid:FourierFlows.jl.git/ (master) $ git push
  Counting objects: 4824, done.
  Delta compression using up to 8 threads.
  Compressing objects: 100% (1639/1639), done.
  Writing objects: 100% (4824/4824), 1.67 MiB | 1.07 MiB/s, done.
  Total 4824 (delta 3061), reused 4824 (delta 3061)
  remote: Resolving deltas: 100% (3061/3061), done.
  To https://github.com/FourierFlows/FourierFlows.jl
   + f669d29...5146e5f ArchivedPhysics -&gt; ArchivedPhysics (forced update)
   + 53da66f...6543491 BetteringTwoModes -&gt; BetteringTwoModes (forced update)
   + 986cde0...a6562c4 BetteringTwoModesSystematically -&gt; BetteringTwoModesSystematically (forced update)
   + 9b7e4e3...8db4ced BetteringTwoModes_StashedChanges -&gt; BetteringTwoModes_StashedChanges (forced update)
   + 4adf9a4...bd7b62c GPUDomains -&gt; GPUDomains (forced update)
   + 40e1318...bd7b4bf GPUTwoModes -&gt; GPUTwoModes (forced update)
   + e2d551c...666d0f9 GPUTwoModes_APVTracerAdv -&gt; GPUTwoModes_APVTracerAdv (forced update)
   + 23f1689...343ab15 TimestepperFormattingImprovements -&gt; TimestepperFormattingImprovements (forced update)
   + 08bcc90...6a59cf1 TracerPatchEqn -&gt; TracerPatchEqn (forced update)
   + 019c115...8b2b6c1 TwoModes -&gt; TwoModes (forced update)
   + 740c9a1...c8c47dd UpdatesDocs -&gt; UpdatesDocs (forced update)
   + 7456358...96c1686 VerticalModes -&gt; VerticalModes (forced update)
   + 0b36327...a111d4e getETDcoeffsBigFLoat -&gt; getETDcoeffsBigFLoat (forced update)
   + f90541a...de0c079 gh-pages -&gt; gh-pages (forced update)
   + 8e1f439...f3e9ac0 makeJulia0p7compatible -&gt; makeJulia0p7compatible (forced update)
   + 3211e48...8828ef5 master -&gt; master (forced update)
   + 6ef5dfc...47c773c v0.0.1 -&gt; v0.0.1 (forced update)
   + d6e2cf8...4e43e7f v0.0.2 -&gt; v0.0.2 (forced update)
   + 3be73f7...dfc1060 v0.1.0 -&gt; v0.1.0 (forced update)
   ! [remote rejected] refs/pull/10/head -&gt; refs/pull/10/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/11/head -&gt; refs/pull/11/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/12/head -&gt; refs/pull/12/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/13/head -&gt; refs/pull/13/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/14/head -&gt; refs/pull/14/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/15/head -&gt; refs/pull/15/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/17/head -&gt; refs/pull/17/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/17/merge -&gt; refs/pull/17/merge (deny updating a hidden ref)
   ! [remote rejected] refs/pull/19/head -&gt; refs/pull/19/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/22/head -&gt; refs/pull/22/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/23/head -&gt; refs/pull/23/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/23/merge -&gt; refs/pull/23/merge (deny updating a hidden ref)
   ! [remote rejected] refs/pull/24/head -&gt; refs/pull/24/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/27/head -&gt; refs/pull/27/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/3/head -&gt; refs/pull/3/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/30/head -&gt; refs/pull/30/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/32/head -&gt; refs/pull/32/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/33/head -&gt; refs/pull/33/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/34/head -&gt; refs/pull/34/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/35/head -&gt; refs/pull/35/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/36/head -&gt; refs/pull/36/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/40/head -&gt; refs/pull/40/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/41/head -&gt; refs/pull/41/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/42/head -&gt; refs/pull/42/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/43/head -&gt; refs/pull/43/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/45/head -&gt; refs/pull/45/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/46/head -&gt; refs/pull/46/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/47/head -&gt; refs/pull/47/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/48/head -&gt; refs/pull/48/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/48/merge -&gt; refs/pull/48/merge (deny updating a hidden ref)
   ! [remote rejected] refs/pull/49/head -&gt; refs/pull/49/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/5/head -&gt; refs/pull/5/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/50/head -&gt; refs/pull/50/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/52/head -&gt; refs/pull/52/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/53/head -&gt; refs/pull/53/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/54/head -&gt; refs/pull/54/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/56/head -&gt; refs/pull/56/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/57/head -&gt; refs/pull/57/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/58/head -&gt; refs/pull/58/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/6/head -&gt; refs/pull/6/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/8/head -&gt; refs/pull/8/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/9/head -&gt; refs/pull/9/head (deny updating a hidden ref)
  error: failed to push some refs to 'https://github.com/FourierFlows/FourierFlows.jl'
  </code></pre>
  
  <p>However, if I push the repository to an empty git repo and then clone it from there it is indeed small. </p>
  
  <pre><code>navid:FourierFlows.jl.git/ (master) $ git remote set-url --push origin https://github.com/navidcy/FourierFlowsMirrored
  navid:FourierFlows.jl.git/ (master) $ git push
  Counting objects: 4824, done.
  Delta compression using up to 8 threads.
  Compressing objects: 100% (1639/1639), done.
  Writing objects: 100% (4824/4824), 1.67 MiB | 1.16 MiB/s, done.
  Total 4824 (delta 3061), reused 4824 (delta 3061)
  remote: Resolving deltas: 100% (3061/3061), done.
  To https://github.com/navidcy/FourierFlowsMirrored
   * [new branch]      ArchivedPhysics -&gt; ArchivedPhysics
   * [new branch]      BetteringTwoModes -&gt; BetteringTwoModes
   * [new branch]      BetteringTwoModesSystematically -&gt; BetteringTwoModesSystematically
   * [new branch]      BetteringTwoModes_StashedChanges -&gt; BetteringTwoModes_StashedChanges
   * [new branch]      GPUDomains -&gt; GPUDomains
   * [new branch]      GPUTwoModes -&gt; GPUTwoModes
   * [new branch]      GPUTwoModes_APVTracerAdv -&gt; GPUTwoModes_APVTracerAdv
   * [new branch]      TimestepperFormattingImprovements -&gt; TimestepperFormattingImprovements
   * [new branch]      TracerPatchEqn -&gt; TracerPatchEqn
   * [new branch]      TwoModes -&gt; TwoModes
   * [new branch]      UpdatesDocs -&gt; UpdatesDocs
   * [new branch]      VerticalModes -&gt; VerticalModes
   * [new branch]      getETDcoeffsBigFLoat -&gt; getETDcoeffsBigFLoat
   * [new branch]      gh-pages -&gt; gh-pages
   * [new branch]      makeJulia0p7compatible -&gt; makeJulia0p7compatible
   * [new branch]      master -&gt; master
   * [new tag]         v0.0.1 -&gt; v0.0.1
   * [new tag]         v0.0.2 -&gt; v0.0.2
   * [new tag]         v0.1.0 -&gt; v0.1.0
   ! [remote rejected] refs/pull/10/head -&gt; refs/pull/10/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/11/head -&gt; refs/pull/11/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/12/head -&gt; refs/pull/12/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/13/head -&gt; refs/pull/13/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/14/head -&gt; refs/pull/14/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/15/head -&gt; refs/pull/15/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/17/head -&gt; refs/pull/17/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/17/merge -&gt; refs/pull/17/merge (deny updating a hidden ref)
   ! [remote rejected] refs/pull/19/head -&gt; refs/pull/19/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/22/head -&gt; refs/pull/22/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/23/head -&gt; refs/pull/23/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/23/merge -&gt; refs/pull/23/merge (deny updating a hidden ref)
   ! [remote rejected] refs/pull/24/head -&gt; refs/pull/24/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/27/head -&gt; refs/pull/27/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/3/head -&gt; refs/pull/3/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/30/head -&gt; refs/pull/30/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/32/head -&gt; refs/pull/32/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/33/head -&gt; refs/pull/33/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/34/head -&gt; refs/pull/34/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/35/head -&gt; refs/pull/35/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/36/head -&gt; refs/pull/36/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/40/head -&gt; refs/pull/40/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/41/head -&gt; refs/pull/41/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/42/head -&gt; refs/pull/42/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/43/head -&gt; refs/pull/43/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/45/head -&gt; refs/pull/45/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/46/head -&gt; refs/pull/46/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/47/head -&gt; refs/pull/47/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/48/head -&gt; refs/pull/48/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/48/merge -&gt; refs/pull/48/merge (deny updating a hidden ref)
   ! [remote rejected] refs/pull/49/head -&gt; refs/pull/49/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/5/head -&gt; refs/pull/5/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/50/head -&gt; refs/pull/50/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/52/head -&gt; refs/pull/52/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/53/head -&gt; refs/pull/53/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/54/head -&gt; refs/pull/54/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/56/head -&gt; refs/pull/56/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/57/head -&gt; refs/pull/57/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/58/head -&gt; refs/pull/58/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/6/head -&gt; refs/pull/6/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/8/head -&gt; refs/pull/8/head (deny updating a hidden ref)
   ! [remote rejected] refs/pull/9/head -&gt; refs/pull/9/head (deny updating a hidden ref)
  error: failed to push some refs to 'https://github.com/navidcy/FourierFlowsMirrored'
  </code></pre>
  
  <p>Any ideas why is that? Apparently somehow I'm not telling git to ditch the files that are up in the repository already...</p>