.gitignore 目录上的 git 警告 "unable to access permission denied"

标签 git gitignore

我在我的一个名为“数据库”的目录中有一个名为“.gitignore”的子目录,我希望 git 忽略它,所以我将它列在我的 .gitingore 文件中。

.gitignore:

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

当我执行类似 git status 数据库的命令时,我收到以下警告:

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

任何人都可以帮助我了解我可以做些什么来摆脱这个警告吗?

PS:我验证了“数据库”和“.gitingore”上的文件夹权限是相同的。

PS:我在 Windows 8 上运行 git。我认为这不重要。

最佳答案

我不确定您遇到了什么,但我认为拥有一个名为 .gitignore文件夹 是个坏主意。 Git 可能会尝试打开它并像读取文件一样读取它,因为它需要知道 .gitignore 文件的内容。

尝试将其命名为其他名称,然后将其名称添加到目录中它旁边的 .gitignore 文件中。

关于.gitignore 目录上的 git 警告 "unable to access permission denied",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25137925/

相关文章:

git - .gitignore 中的异常

Gitignore 不会忽略特定文件夹

git - 如何修改 Git 中的多个提交以更改作者

git - 如何提交/推送 git 别名(在 .git/config 中)?

git - git 分支上的提交数

Linux 内核 : Kernel version string appended with either '' +"or "-dirty"

gitignore 匹配字符重复

Git2go - pull && merge

ruby-on-rails - Sunspot Solr Gem & .gitignore

git - 将 .gitignore 添加到 gitignore