Fixing Homebrew warnings after upgrading to macOS Sierra

You might have already noticed that Homebrew is showing warnings after upgrading the system to macOS Sierra.

$ brew update
error: The last gc run reported the following. Please correct the root cause  
and remove .git/gc.log.  
Automatic cleanup will not be performed until the file is removed.

warning: There are too many unreachable loose objects; run 'git prune' to remove them.

Auto packing the repository in background for optimum performance.  
See "git help gc" for manual housekeeping.  
error: The last gc run reported the following. Please correct the root cause  
and remove .git/gc.log.  
Automatic cleanup will not be performed until the file is removed.

warning: There are too many unreachable loose objects; run 'git prune' to remove them.  

In order to get rid of it, you should run these commands: cd "$(brew --repo)" && git prune && git gc.

Homebrew will stop throwing warnings after that.

$ brew update
Already up-to-date.  

Michael Samoylov

Python, JavaScript and Swift Expert with 12+ years of experience.

Vilnius, Lithuania https://monmar.tech

Subscribe to Michael Samoylov

Get the latest posts delivered right to your inbox.

or subscribe via RSS with Feedly!