9/13/2016 - 2:47 AM

# Get Homebrew in the new location
git clone ~/Homebrew

# Move all your installed packages to the new location
mv /usr/local/Cellar ~/Homebrew/Cellar
mv /usr/local/Library ~/Homebrew/Library

# Remove "root" directory files left behind
rm -rf /usr/local/.git /usr/local/{.gitignore,.yardopts,,,LICENSE.txt,,}

# Remove all the now-broken symlinks
brew prune

# Create a symlink to `brew` executable from /usr/local/bin -- seemed like a good idea...
ln -sf ~/Homebrew/bin/brew /usr/local/bin/brew

# Fix all your symlinks :)
for $PKG in $(brew list); do brew link $PKG; done

# Symlink the important folders
ln -s ~/Homebrew/Cellar /usr/local/Cellar
ln -s ~/Homebrew/Library /usr/local/Library