22人参与 • 2026-03-11 • 其他编程
首先 .gitignore 只能忽略那些没有被追踪(track)的文件,且git存在本地缓存。
如果需要过滤文件之前已纳入了版本管理,那么除了修改ignore文件,还要清除本地缓存。
git rm -r --cached . git add . git commit -m "update .gitignore"
# compiled class file *.class # log file *.log *.imi *.lst # bluej files *.ctxt # mobile tools for java (j2me) .mtj.tmp/ # package files # *.jar *.war *.nar *.ear *.zip *.tar.gz *.rar # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* .idea *.iml out .settings/ .project .classpath /*/target/ logs/ .txlcn # ignore test file **/src/test/
.ds_store # node_modules 正常工作时需要过滤该文件 /dist # local env files .env.local .env.*.local # log files npm-debug.log* yarn-debug.log* yarn-eroor.log* pnpm-debug.log* # editor directories and files .idea .vscode *.suo *.ntvs* *.njsproj *.sln *.sw?
以上为个人经验,希望能给大家一个参考,也希望大家多多支持代码网。
您想发表意见!!点此发布评论
版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。
发表评论