git --version
brew install git
brew link git --overwrite
git --version
brew install git时提示:
Error: /usr/local/Cellar is not writable. You should change the
ownership and permissions of /usr/local/Cellar back to your user
account: sudo chown -R $(whoami) /usr/local/Cellar Error: The
following directories are not writable by your user: /usr/local/CellarYou should change the ownership of these directories to your user.
sudo chown -R $(whoami) /usr/local/CellarAnd make sure that your user has write permission. chmod u+w
/usr/local/Cellar解决: 先执行sudo chown -R $(whoami) /usr/local/Cellar,然后再brew install git