DevToolBox

.gitignore Generator

言語・フレームワーク・IDEを選択して.gitignoreファイルを自動生成。24種類のテンプレート対応。

Languages

Frameworks

IDE

OS

DevOps

カスタム追加

# テンプレートを選択してください

.gitignore Generatorの使い方

使用する言語、フレームワーク、IDE、OSを選択するだけで、適切な.gitignoreファイルが 自動生成されます。複数のテンプレートを組み合わせて、プロジェクトに最適な設定を作成できます。 カスタムパターンの追加も可能です。

How to Use the .gitignore Generator

Select your programming languages, frameworks, IDEs, and operating systems to generate a comprehensive .gitignore file. Templates can be combined freely, and custom patterns can be added. Includes 24 templates covering Node.js, Python, Java, Go, React, Next.js, Django, Docker, and more. Copy the output and save it as .gitignore in your project root.

よくある落とし穴と対処 / Common Pitfalls

落とし穴 / Pitfall問題 / Problem対処 / Fix
追加したのに無視されない
Patterns added but files still tracked
.gitignore は「未追跡ファイル」にのみ効く。既に commit 済みのファイルは対象外
.gitignore only affects untracked files
git rm --cached <file> で追跡を外してからコミット
Untrack with git rm --cached first
ディレクトリ指定の末尾 /
Trailing slash semantics
build/ はディレクトリのみ、build は同名ファイルにも一致
build/ matches only directories
ディレクトリには末尾 / を付けて意図を明確に
Use trailing slashes for directories
否定パターン(!)が効かない
Negation (!) not working
親ディレクトリ自体が無視されていると、その中の ! は無効
You cannot re-include files inside an ignored directory
dir/* で中身だけ無視し、!dir/keep.txt で除外する
Ignore dir/* then negate specific files
.env が漏れてコミットされる
.env committed with secrets
テンプレ適用前にコミットしてしまう初期事故が多い
Secrets land in history before the template exists
リポジトリ作成直後に .gitignore を最初のコミットへ。漏れたら鍵をローテーション
Commit .gitignore first; rotate leaked keys
IDE設定をチーム全員分無視
Ignoring editor files per-project
.idea/ や .vscode/ を各リポジトリに書くと肥大化
Editor patterns bloat every repo
個人環境分は core.excludesFile(グローバルgitignore)へ
Use a global gitignore for personal tooling

コマンド例 / Commands

# 追跡済みファイルを.gitignore対象にする
git rm --cached .env
git commit -m "stop tracking .env"

# あるファイルがどのルールで無視されているか調べる
git check-ignore -v node_modules/foo.js

# グローバルgitignoreの設定
git config --global core.excludesFile ~/.gitignore_global

生成例 / Example Output

# Node.js + Next.js + VSCode を選択した場合(抜粋)
node_modules/
.next/
out/
.env*
!.env.example
.vscode/*
!.vscode/extensions.json

Why browser-only?

Your template selections reveal your stack, and custom patterns may include internal path names. This generator assembles the file entirely in your browser from bundled templates — no selection is transmitted, nothing is logged, and it works offline. Check the DevTools Network tab: zero requests.

生成はバンドル済みテンプレートからブラウザ内で完結し、選択内容が外部送信されることはありません。 コンフリクト時の対処はgitマージコンフリクトの解消手順もどうぞ。 .gitignoreを書いたのに反映されない場合は効かない原因と対処ガイドで解決できます。

関連ツール / Related Tools

開発をもっと効率的に

PR