Using Git to Reduce Repo Size, If You get an “There are too many unreachable loose objects” Error
Posted on May 19, 2016 in Command Line, Git by Matt Jennings

The info below was taken from a Git post on AlBlue’s Blog in 2011 and this Stack Overflow question posted in January 2010:

  1. Open your shell on your computer (like Terminal for Mac) and navigate to your Git repo.
  2. Once inside your Git repo, do the commands below, pressing Enter on your keyboard after each command. These commands will remove any references to deleted Git branches and compress your Git repo.

    git reflog expire --all --expire=now
    git gc --prune=now --aggressive

Leave a Reply

To Top ↑