簡體   English   中英

有沒有辦法不為在 macOS 中使用 git 編寫“sudo”?

[英]Is there a way to not write 'sudo' for using git in macOS?

我在 macOS Catalina 上,每次使用 git 命令時,我都必須使用sudo git $CMD 沒有它,諸如unable to access '/Users/$USER/.config/git/...': Permission Denied之類的錯誤仍然存在。 我想在全球范圍內解決這個問題,這樣我就不必為每個存儲庫編寫 sudo 了。

全局修復:

sudo chown -R ${USER}:${GROUP} "/Users/${USER}/.config"

如果沒有群,

sudo chown -R ${USER} "/Users/${USER}/.config"

該解決方案歸功於 Discord(CS Army)上的 TheDevMinerTV。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM