git - .git/info/exclude 不排除未跟踪的文件
问题描述
无论我是在将文件添加到排除文件之前还是之后创建文件,它都不会忽略它。
$: cat ./.git/info/exclude
/*.php
/license.txt
/wp-admin
/wp-includes
/wp-content/themes/impact/page-test.php
wp-content/themes/impact/page-test.php
page-test.php
$: git status
On branch development
Your branch is up-to-date with 'origin/development'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
wp-content/themes/impact/page-test.php
nothing added to commit but untracked files present (use "git add" to track)
解决方案
检查 gitignore 规则是否没有在其他地方被覆盖
用于git check-ignore -v <PATH>
列出影响 的忽略状态的最后一条规则PATH
。
应用 gitignore 规则的顺序在文档中列出:https ://git-scm.com/docs/gitignore
$HOME/.config/git/ignore, $GIT_DIR/info/exclude, .gitignore
(第一个“全局 gitignore”路径可以用 更改git config --global core.excludesfile
)
并且.gitignore
子文件夹中的文件可能会覆盖此类文件夹及其子文件夹的规则...
推荐阅读
- r - R Markdown 中的图像位置
- c# - 如何使用 linq 实现“模板”模式?
- javascript - 为什么时刻 js 无法处理转换:|?
- php - 表单流程处理
- r - 如何从 R 中的 data.frame 文件中删除文本中的标点符号和数字
- php - 使用php在head标签内设置css属性
- angularjs - 使用 angularJS $timeout 函数并在服务调用时重新加载页面
- material-design - 如何将 Material Design 组件导入 Progressive Web App Starter Kit?
- angular - AWS S3 存储桶中的 Angular 4 App 导致 CORS 错误
- python - 从 List 中删除列表项后的行为
- 在蟒蛇