Git warnings when updating homebrew OS X

Viewed 5461
Last login: Mon Mar  7 17:35:51 on console
~ brew update
warning: unable to access '/Users/Jason/.config/git/ignore': Permission denied
warning: unable to access '/Users/Jason/.config/git/attributes': Permission denied
Updated Homebrew from 7f8aa6d to d08692f.
==> New Formulae
cucumber-cpp               prometheus                 znapzend
==> Updated Formulae
afl-fuzz            gtk+                orc                 writerperfect
crystal-lang        kafka               platformio
dependency-check    libvirt             sslscan
ghq                 logtalk             syncthing
~

I'm running El Capitan on my macbook and whenever I try to update homebrew I'm getting those warnings. I'm looking for a solution on how I can stop these warnings from happening.

2 Answers

based on R.Q's answer, just in case a complete noob like me hit this question. here are 2 lines to copy and paste:

sudo chown -R $USER ~/.config
sudo chmod -R 744 ~/.config

The reason for

> brew install somepackage
warning: unable to access '/Users/username/.config/git/attributes': Permission denied

appearing is as wisbucky's comment, sudo'ing some commands like htop.

once you run the commands above, running 'sudo htop' again should no longer cause issues!

Related