Reference Reference reference

.gitignore

.gitignore 定义 Git 应忽略的未跟踪文件。

语法

text
node_modules/
dist/
.env

最小示例

bash
printf "dist/\n.env\n" >> .gitignore

常见错误

  • 只看语法不看运行环境限制。
  • 没有处理错误、权限或兼容性分支。
  • 示例上线前应结合真实浏览器、服务器或 Git 仓库验证。

相关内容