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] 删除。
我来说两句