git警告“无法访问权限被拒绝";在.gitignore目录上 [英] git warning "unable to access permission denied" on a .gitignore directory
问题描述
我在我的一个名为数据库"的目录中有一个名为".gitignore"的子目录,我希望git忽略它,因此我将其列在我的.gitingore文件中.
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:
.gitignore:
[Bb]in/
[Dd]ebug/
[Rr]elease/
.gitignore/
当我执行git status Database之类的命令时,收到以下警告:
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:我验证了数据库"和".gitingore"的文件夹权限是相同的.
PS: I verified folder permissions on both "Database" and ".gitingore" were the same.
PS:我在Windows 8上运行git.我认为这无关紧要.
PS: I am running git on Windows 8. I don't think this matters.
推荐答案
我不确定您遇到了什么,但我想拥有一个名为.gitignore
的文件夹是个坏主意. Git可能正试图打开它并像读取文件一样读取它,因为它需要知道.gitignore
文件的内容.
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.
尝试使用其他名称,然后将其名称添加到目录中位于其旁边的.gitignore
文件中.
Try calling it something else and then adding its name to a .gitignore
file next to it in the directory.
这篇关于git警告“无法访问权限被拒绝";在.gitignore目录上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!