Fatal: unable to access '//etc/gitconfig': Permission denied

Hello all,

I have been struggling for month on an issue with Git (Git Hub, Git Hub Desktop, VS Code CLI), using a mac.

Every command I’m using (in terminal or VS code) is giving me the following message fatal: unable to access ‘//etc/gitconfig’: Permission denied.

I have seen a lot of topics around this issue but no solution worked for me. I have the feeling that the issue is linked to my zsh file but even with changing PATH it doesn’t work.

I have used all ideas to fix this issue without any success.

Hope someone can help me figure out what is wrong on my computer.

Thanks’ for any support

ls -hald /etc /etc/gitconfig
sudo chmod 0644 /etc/gitconfig
ls -hald /etc/gitconfig

I should probably give a reference for why you’re seeing the error…
https://git-scm.com/docs/git-config#FILES

Basically git checks the system file and then your user file for customizations and then the repository file for local things, etc.

But someone probably used a fancy editor that made the global file unreadable by your user.

https://explainshell.com/explain?cmd=ls+-hald+%2Fetc+%2Fetc%2Fgitconfig%3B+sudo+chmod+0644+%2Fetc%2Fgitconfig%3B+ls+-hald+%2Fetc%2Fgitconfig

Hi jsoref,

Thanks’ for your feedback.

I have made some tricks and I guess I found the error. The gitconfig file it was looking for was not directly on the home/etc/ but on a /private folder on which I didn’t have permission. I changed it and it looks like it works correctly now. I will keep testing to make sure everything is ok.