当我做一些混帐的操作,比如“git diff
”或“git add .
”,充分显示了警告:无法访问“/Users/dida/.config/git/attributes”:权限被拒绝
unable to access '/Users/dida/.config/git/attributes': Permission denied
我想知道我做错了哪个配置,我该如何解决?
这是一个与某些命令更好,我使用mac命令行
当我做一些混帐的操作,比如“git diff
”或“git add .
”,充分显示了警告:无法访问“/Users/dida/.config/git/attributes”:权限被拒绝
unable to access '/Users/dida/.config/git/attributes': Permission denied
我想知道我做错了哪个配置,我该如何解决?
这是一个与某些命令更好,我使用mac命令行
Git使用的HOME
和XDG_CONFIG_HOME
环境设置来查找配置文件。
确保他们得到适当的设置,哟当前用户(检查id command的结果)
检查也git config -l --show-origin
看到其中 Git是试图访问这些配置文件。
似乎你运行了sudo -H
,sudo将一些文件的所有权更改为root
。取回文件:
sudo chown -R dida /Users/dida