Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git warnings when updating homebrew OS X

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.

like image 686
koven Avatar asked Mar 07 '16 22:03

koven


People also ask

How long does Homebrew update take?

From 20 minutes to an hour. The devs are aware.

Does Homebrew automatically update packages?

An easy, convenient way to automatically update Homebrew. This script will run brew update in the background once every 24 hours (by default) until explicitly told to stop, utilising launchd . brew upgrade and brew cleanup can also be handled automatically but are optional flags.

How do I fix error not a valid ref refs remotes origin master?

Accepted Answer - 1. To fix this error, remove the following file YOURPROJECT/. git/refs/remotes/origin/master , and then run git fetch to download it again.


2 Answers

You shouldn't run brew with root privileges unless really needed. Run brew doctor and check the permissions on /Users/Jason/.config:

chown -R Jason:staff ~/.config
chmod -R 744 ~/.config
like image 130
R. Q. Avatar answered Oct 17 '22 16:10

R. Q.


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!

like image 40
taiyodayo Avatar answered Oct 17 '22 16:10

taiyodayo