✨ ..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 即可。可繼續手動追加專案特有忽略項。