Core 用 .gitignore
Core 用の除外ルール 27 件。そのままリポジトリにコピーして使えます。
.NET Core プロジェクト (コミュニティ テンプレート)
Core 用 .gitignore の完全版
# LFGitignore によって生成 - https://lfgitignore.com
# 作成日:2026-10-31 22:52:37 UTC
# 技術:Core
### Core ###
# macOS フォルダー設定 (デスクトップ サービス ストア)
.DS_Store
[Dd]ebug/
*.*~
[Dd]ebugPublic/
[Rr]elease/
project.lock.json
[Rr]eleases/
x64/
# Vimスワップファイル
*.swp
nupkg/
x86/
.vscode
# ユーザー固有の設定
*.user
.idea
# ソリューション ユーザー オプション
*.suo
*.userosscache
bld/
*.pyc
*.sln.docstates
[Bb]in/
[Oo]bj/
# ビルド出力ディレクトリ
build/
msbuild.log
msbuild.err
msbuild.wrn
.vs/
[Oo]ut/
Core のルールで除外されるもの
以下の各パターンと、.gitignore に含める理由を説明します。
一般的な
| パターン |
除外対象 |
.DS_Store |
macOS フォルダー設定 (デスクトップ サービス ストア) |
*.*~ |
一般的な |
project.lock.json |
一般的な |
*.swp |
Vimスワップファイル |
nupkg/ |
一般的な |
*.pyc |
一般的な |
ビルド結果
| パターン |
除外対象 |
[Dd]ebug/ |
ビルド結果 |
[Dd]ebugPublic/ |
ビルド結果 |
[Rr]elease/ |
ビルド結果 |
[Rr]eleases/ |
ビルド結果 |
x64/ |
ビルド結果 |
x86/ |
ビルド結果 |
bld/ |
ビルド結果 |
[Bb]in/ |
ビルド結果 |
[Oo]bj/ |
ビルド結果 |
build/ |
ビルド出力ディレクトリ |
msbuild.log |
ビルド結果 |
msbuild.err |
ビルド結果 |
msbuild.wrn |
ビルド結果 |
[Oo]ut/ |
ビルド結果 |
Visual Studio Code
| パターン |
除外対象 |
.vscode |
Visual Studio Code |
ユーザー固有のファイル
| パターン |
除外対象 |
*.user |
ユーザー固有の設定 |
*.suo |
ソリューション ユーザー オプション |
*.userosscache |
ユーザー固有のファイル |
*.sln.docstates |
ユーザー固有のファイル |
Visual Studio 2015
| パターン |
除外対象 |
.vs/ |
Visual Studio 2015 |
この Core 用 .gitignore の使い方
- 上の Core 用ルールをコピーするか、ファイルを直接ダウンロードしてください。
- Git リポジトリのルートに .gitignore という名前のファイルを作り、ルールを貼り付けます。
- 対象のファイルがすでに追跡されている場合は、git rm -r --cached . を実行して再度コミットしてください。Git の除外ルールは未追跡のファイルにのみ適用されます。
- チーム全員で同じルールを共有できるよう、.gitignore をコミットします。