Fix “warning: unable to access /Users/Name/.config/git/attributes Permission Denied” Errors

Mar 30, 2024 - Leave a Comment

Unable to access config git attributes and other files with permission denied error at the command line

If you’re at the command line and perhaps interacting with Homebrew, Git, or similar, you may run into an error message that says something like the following “warning: unable to access /Users/Name/.config/git/attributes” : Permission denied”.

This error message sounds more alarming than it is in most cases, but regardless, you likely want to fix the error and remedy the permissions issue so that you no longer receive the ‘unable to access ~/.config/git/attributes’ error message.

An example of this error message sequence is repeated below, encountered, in this case, when attempting to update Homebrew:

% brew update
warning: unable to access '/Users/Paul/.config/git/ignore': Permission denied
warning: unable to access '/Users/Paul/.config/git/attributes': Permission denied
warning: unable to access '/Users/Paul/.config/git/attributes': Permission denied
warning: unable to access '/Users/Paul/.config/git/ignore': Permission denied
Updated 2 taps (homebrew/core and homebrew/cask)

How to Fix “unable to access .config/git/attributes” Error

To resolve this error message, you must change ownership of the files and/or directories that are being impacted. This can be done easily with the chown command.

From the command line, assuming you’re in your home directory, type the following, replacing the username with your own:

sudo chown -R Paul .config

chown will change ownership, with the -R flag, recursively, through the .config directory, so that everything within the .config directory is owned by the specified user.

What causes the “unable to access ~/.config/git/attributes” error?

If you encounter this error message, and you investigate the ownership of .config directory and its subdirectories and files, you will usually find that it is owned by root.

This typically happens because you ran a prior command, whether that’s brew, git, htop, or similar, as root or with sudo, and thus the creation of the .config directory or a subdirectory had root ownership.

You can check the ownership of the .config directory with the following command:

ls -la ~/

Where you find .config you will see the ownership of that directory as well, which if you’re seeing that error message, is typically ‘root’:

See permissions of the git config directory which is the cause of the error message

Correcting this error is therefore a matter of running the aforementioned sudo chown command, with the user to which the directory should belong (ie; the active users home directory).

It’s worth pointing out that this error message can be encountered on a variety of operating systems and command lines, whether it’s MacOS, Linux, Windows WSL, FreeBSD, or similar. We’re of course focusing on the Mac side of things here (and in this case, the error was encountered with updating Homebrew), but the solution is the same regardless of the platform you’re running.

Did this resolve the “unable to access ~/.config/git/attributes” error message for you? Did you find another solution or cause of the error on your particular machine? Let us know in the comments.


Related articles:

Posted by: Paul Horowitz in Command Line, Troubleshooting

Leave a Reply


Shop on and help support OSXDaily!

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates

Tips & Tricks


iPhone / iPad



Shop on Amazon to help support this site