If you have run brew as root or with sudo prefix, later updates to brew fail to change the git versioning. Additionally, the directory permissions to /usr/local and /Library/Caches/Homebrew gets restricted to root only.
To correct this all you need is execute the below command in your terminal:
# Reset the permissions of /usr/local and Homebrew's caches to the current user:
$ sudo chown -R $USER:admin /usr/local /Library/Caches/Homebrew
You now should have got your freedom back ;)
To correct this all you need is execute the below command in your terminal:
# Reset the permissions of /usr/local and Homebrew's caches to the current user:
$ sudo chown -R $USER:admin /usr/local /Library/Caches/Homebrew
You now should have got your freedom back ;)