コンテンツにスキップ

Git Config

Git の global 設定。commit message template と gitignore を共通化している。

Conventional Commits 形式の template を ~/.config/git/message に定義。git commit 時にテンプレートが表示される。

<type>[(scope)]: <description>
Type用途
feat新機能
fixbug fix
docsdocument のみの変更
styleformatting, semicolon など
refactor機能変更を伴わないコード修正
perfperformance 改善
testtest の追加・修正
chorebuild, CI, 依存関係の更新

type の後に ! を付けて breaking change を示す。

feat(auth)!: implement OAuth2 authentication

footer に BREAKING CHANGE: を記述して詳細を説明。

~/.config/git/ignore で全 repository 共通の ignore pattern を定義。

.DS_Store
Thumbs.db
._*
.go-version
.node-version
.python-version
.ruby-version
.tool-versions
.mise.toml
.idea/
.vscode/
*.swp
*.swo
.env
.env.local
.envrc
makefile.local
docker-compose.local.yml
config.local.*
*.local.json
*.local.yaml
node_modules/
vendor/
.bundle/
**/.claude/settings.local.json
**/.claude/telemetry/
File内容
~/.config/git/config.localuser.name, user.email
~/.config/git/messagecommit template
~/.config/git/ignoreglobal gitignore