✨ ..gitignore Generator
.gitignore Generator - Pick stacks (Python/Node/Go/Rust/Java/.NET/IDE) and merge a ready .gitignore file. Free, browser-only.
📐 工作原理与说明
内置各技术栈的忽略规则表(每项含显示名与规则条目)。收集所有被勾选且存在于规则表中的技术栈键;一条都没选时提示请至少选择一种技术栈。否则先写入生成说明的注释行,再对每个被选中的技术栈依次写入一个空行、以井号开头的显示名注释,以及该栈的全部规则条目。最终按行拼接输出
按技术栈生成 .gitignore 忽略规则。
- 语法:
#注释、*通配、**跨目录、/开头仅匹配根目录、!取反。 - 模板:按语言(Node/Python/Java)、框架与编辑器选择模板合并生成。
- 范围:只作用于未跟踪文件;已入库文件需先
git rm --cached才会被忽略。 - 全局:可用
core.excludesFile配置跨仓库的全局忽略规则。
Formula & Standard References
| Item | Formula / Note | Source / Standard |
|---|---|---|
| Pattern syntax | glob: * single level, ** recursive, ? one char, [] set | gitignore documentation |
| Negation | ! re-includes a path; order determines the result | gitignore documentation |
| Directory match | trailing / matches directories only; leading / anchors to root | gitignore documentation |
⚠️ 使用说明与注意事项
- 勾选项对应各生态官方社区模板的精简版;多栈项目直接合并即可,重复项无害。
- .gitignore 对已被跟踪的文件不生效——若误提交了 node_modules,需先 git rm --cached 再忽略。
- 机密文件(.env)务必忽略;但 .gitignore 不是安全边界,敏感信息请勿入库。
📋 提示
生成后保存为项目根目录的 .gitignore 即可。可继续手动追加项目特有忽略项。