尽管我在 .gitignore 和 `.git/info/exclude` 中排除了它,git 不会停止跟踪特定的自动生成的文件

阿纳托利

Git 不会停止跟踪项目中特定的自动生成文件。我有一个在项目运行时自动生成的特定文件:platform/views/index.html. 我已将它添加到.gitignore, to .git/info/exclude, run 上,git rm --cached platform/views/index.html但每次重新创建时,git 都会问我想用它做什么。

我怎样才能让 git 永远停止跟踪这个文件?谢谢你。

我的.gitignore文件:

dump.rdb
*.DS_Store
.vscode
.sfdx
npm-debug.log
**/.idea
**/node_modules
.vs
**/.history
newrelic_agent.log
platform/api/modules/interactions/entity-mock.js
platform/views/
威廉·珀塞尔

如果要忽略目录中的所有文件,请使用:

platform/views/**

在 gitignore 中。如果您只想忽略一个文件,请使用:

platform/views/index.html

该模式platform/views与文件不匹配,因此您当前的 .gitignore 不会忽略该文件。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章