title: git gc --aggressive --prune=all does not remove big file from repository
body: <p>There are many SO questions regarding "how to remove an accidentally added big file from repo", many of them suggesting using <code>git gc</code> command. However, I find it not working for me and I don't know what's going wrong.</p>
  
  <p>Here is what I have done:</p>
  
  <pre><code>$ git init
  Initialized empty Git repository in /home/wzyboy/git/myrepo/.git/
  $ echo hello &gt;&gt; README
  $ git add README 
  $ git commit -a -m 'init commit'
  [master (root-commit) f21783f] init commit
   1 file changed, 1 insertion(+)
   create mode 100644 README
  $ du -sh .git
  152K    .git
  $ cp ~/big.zip .
  $ git add big.zip 
  $ git commit -a -m 'adding big file'
  [master 3abd0a4] adding big file
   1 file changed, 0 insertions(+), 0 deletions(-)
   create mode 100644 big.zip
  $ du -sh .git
  77M .git
  $ git log --oneline 
  3abd0a4 adding big file
  f21783f init commit
  $ git reset --hard f21783f
  HEAD is now at f21783f init commit
  $ git log --oneline 
  f21783f init commit
  $ git gc --aggressive --prune=all
  Counting objects: 6, done.
  Delta compression using up to 4 threads.
  Compressing objects: 100% (4/4), done.
  Writing objects: 100% (6/6), done.
  Total 6 (delta 0), reused 0 (delta 0)
  $ git gc --aggressive --prune=now
  Counting objects: 6, done.
  Delta compression using up to 4 threads.
  Compressing objects: 100% (4/4), done.
  Writing objects: 100% (6/6), done.
  Total 6 (delta 0), reused 6 (delta 0)
  $ du -sh .git
  77M .git
  $ git version
  git version 2.2.2
  </code></pre>
  
  <p>In the console output above, I created a new git repo, added one small text file and the <code>.git</code> directory is 152K in size, so far so good. Then I added a big file into the repo and the directory bloats to 77M. However, aftering my attempting to remove the big file (<code>git reset --hard</code> or <code>git rebase -i</code>), I cannot recover the disk space claimed by the big file, no matter how I run <code>git gc</code> with different options.</p>
  
  <p>Could any one tell me why <code>git gc</code> does not work in my case? What should I do to recover the disk space? Is it possible to recover the disk space using <code>git gc</code> instead of <code>git filter-branch</code>?</p>
  
  <p>Thanks.</p>