Search code examples
gitgitignore

git warning "unable to access permission denied" on a .gitignore directory


I have a sub-directory called ".gitignore" in one of my directories called "Database", which I want git to ignore, so I listed it in my .gitingore file.

.gitignore:

    [Bb]in/
    [Dd]ebug/
    [Rr]elease/
    .gitignore/

When I perform a command like git status Database, i get the following warning:

warning: unable to access 'Database/.gitignore': Permission denied

Can anyone please help me understand what I can do to get rid of this warning?

PS: I verified folder permissions on both "Database" and ".gitingore" were the same.

PS: I am running git on Windows 8. I don't think this matters.


Solution

  • I'm not sure what you're experiencing but I would imagine that having a folder called .gitignore is a bad idea. Git might be trying to open it and read it like a file as it needs to know the contents of .gitignore files.

    Try calling it something else and then adding its name to a .gitignore file next to it in the directory.