更新自制OS X时的Git警告

kov*_*ven 5 git macos homebrew

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
~
Run Code Online (Sandbox Code Playgroud)

我在我的macbook上运行El Capitan,每当我尝试更新自制软件时,我都会收到这些警告.我正在寻找一个解决方案,我可以阻止这些警告的发生.

R. *_* Q. 11

brew除非确实需要,否则不应使用root权限运行.运行brew doctor并检查以下权限/Users/Jason/.config:

chown -R Jason:staff ~/.config
chmod -R 744 ~/.config
Run Code Online (Sandbox Code Playgroud)

  • @koven:如果答案对您有帮助,请将此答案标记为已接受的答案.如果你解释为什么它没有帮助你,那将是很好的. (2认同)
  • 注意:如果您使用“sudo”运行任何命令,并且创建了“~/.config”目录,则可能会发生这种情况。例如“sudo htop”。 (2认同)