當我做一些混帳的操作,比如「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