I run this:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
==> Downloading and installing Homebrew...
fatal: cannot copy '/usr/local/git/share/git-core/templates/hooks/pre-receive.sample' to '/usr/local/Homebrew/.git/hooks/pre-receive.sample': Permission denied
Failed during: git init -q
You are getting permission denied when downloading the files into
This folder often belongs to root. This is a known issue with brew. Fix it by doing
sudo chown $(whoami) /usr/local
and then re-run the installer.