How to fix warning: unable to access '.git/info/exclude': Permission denied in Git

GitBEGINNERLOWUpdated Dec 6, 2025ยท 153 views

Git cannot read or access the .git/info/exclude file, which stores local ignore patterns. This typically occurs due to missing file, incorrect permissions, or filesystem issues.

Quick fix

Fixes warning: unable to access '.git/info/exclude': Permission denied

ls -la .git/info
  1. Verify the .git/info directory exists
  2. Create the exclude file if missing
  3. Fix file permissions
  4. Check for directory instead of file
git โ€” error
ls -la .git/info
warning: unable to access '.git/info/exclude': Permission denied

What this error means

The .git/info/exclude file is a special Git configuration file that stores ignore patterns specific to your local repository. Unlike .gitignore files which are tracked and shared with other developers, the exclude file is local-only and lives inside the .git directory. When Git encounters an error accessing this file, it means either the file doesn't exist, has incorrect permissions, or there's a filesystem-level problem preventing access. This error commonly appears as a warning during git status, git add, or other commands that need to check which files should be ignored. While Git can usually continue operating even with this warning, it may cause unexpected behavior with file tracking if you were relying on patterns in the exclude file. The .git/info/exclude file serves the same purpose as .gitignore but is never committed to the repository. It's useful for ignoring files that are specific to your local development environment, such as editor configurations, temporary files, or personal debugging scripts that other collaborators don't need to ignore.

Typical symptoms

  • Warning message "unable to access '.git/info/exclude'" appears during git commands
  • Permission denied error when Git tries to read the exclude file
  • Git commands complete but show unexpected warnings
  • Files that should be ignored locally are shown as untracked
  • git status shows more files than expected

Common causes

  1. The .git/info/exclude file doesn't exist (it's optional and not created by default)
  2. Insufficient permissions to read the .git/info/exclude file
  3. The .git/info directory is missing or has incorrect permissions
  4. Filesystem corruption or access issues with the .git directory
  5. Git for Windows bug with network drives or certain filesystems (fscache issue)
  6. SELinux or AppArmor policies blocking access to the file
  7. Incorrect file path specified in core.excludesfile configuration
  8. A directory exists where the file should be

How to fix "warning: unable to access '.git/info/exclude': Permission denied"

1Verify the .git/info directory exists

First, check if the info directory exists within your .git folder:

bash
ls -la .git/info

If the directory doesn't exist, create it:

bash
mkdir -p .git/info
2Create the exclude file if missing

If the exclude file doesn't exist, create it as an empty file or with your desired patterns:

bash
touch .git/info/exclude

Alternatively, create it with an editor:

bash
nano .git/info/exclude

The file can be empty or contain patterns just like .gitignore. Each pattern should be on a new line.

3Fix file permissions

Check the current permissions of the exclude file:

bash
ls -l .git/info/exclude

Ensure the file is readable by your user. Fix permissions if needed:

bash
chmod 644 .git/info/exclude

If the entire .git/info directory has permission issues:

bash
chmod 755 .git/info
4Check for directory instead of file

Verify that .git/info/exclude is a file and not a directory:

bash
file .git/info/exclude

If it's a directory by mistake, remove it and create the correct file:

bash
rm -rf .git/info/exclude
touch .git/info/exclude
5Verify core.excludesfile configuration

Check if you have a conflicting excludesfile configuration:

bash
git config --get core.excludesfile

If this points to an incorrect location or a directory instead of a file, remove or fix it:

bash
git config --unset core.excludesfile

Or update it to point to the correct global exclude file (usually in your home directory):

bash
git config --global core.excludesfile ~/.gitignore_global
6Test with git check-ignore

After fixing the issue, verify that Git can now read the exclude file:

bash
git check-ignore -v some-file

This will show which ignore file (if any) is causing a file to be ignored, confirming that .git/info/exclude is being read correctly.

Advanced notes

For Git for Windows users experiencing this error on network drives or with the fscache feature, consider upgrading to Git version 2.21.0 or later, which fixed a known bug. You can also disable fscache as a workaround: git config core.fscache false

If you're encountering line ending issues (particularly on Windows/MSYS2), convert the file to Unix format: dos2unix .git/info/exclude

Remember that the .git/info/exclude file only affects untracked files. If a file is already being tracked by Git, adding it to the exclude file won't stop Git from tracking it. You'll need to use git rm --cached to untrack it first.

For system administrators dealing with SELinux or AppArmor, you may need to adjust security policies to allow Git to access files within the .git directory. Check audit logs for specific policy violations.

The .git/info/exclude file uses the same pattern syntax as .gitignore: wildcards (*), directory indicators (/), negation (!), and comments (#). Patterns are relative to the repository root.

Frequently asked questions

What does "warning: unable to access '.git/info/exclude': Permission denied" mean?
git/info/exclude file is a special Git configuration file that stores ignore patterns specific to your local repository. git directory. When Git encounters an error accessing this file, it means either the file doesn't exist, has incorrect permissions, or there's a filesystem-level problem preventing access.
How do I fix "warning: unable to access '.git/info/exclude': Permission denied"?
Git cannot read or access the .git/info/exclude file, which stores local ignore patterns. This typically occurs due to missing file, incorrect permissions, or filesystem issues.
What causes "warning: unable to access '.git/info/exclude': Permission denied"?
The .git/info/exclude file doesn't exist (it's optional and not created by default) Insufficient permissions to read the .git/info/exclude file The .git/info directory is missing or has incorrect permissions
Is the "warning: unable to access '.git/info/exclude': Permission denied" error serious?
It is a low-severity error โ€” more of a blocker than a risk. The steps above resolve it.

Official resources & further reading