Unity .gitignore Template

The full, current Unity .gitignore template — copy it as-is, or head to the .gitignore Generator to merge it with other stacks into one file.

Template

/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/[Ll]ogs/
/[Uu]ser[Ss]ettings/

# MemoryCaptures can get excessive in size, don't commit these
/[Mm]emoryCaptures/

# Asset meta data should only be ignored when the corresponding asset is also ignored
!/[Aa]ssets/**/*.meta

# Autogenerated Jetbrains Rider plugin
[Aa]ssets/Plugins/Editor/JetBrains*

# Visual Studio cache directory
.vs/

# Gradle cache directory
.gradle/

# Autogenerated VS/MD/Consulo solution and project files
ExportedObj/
.consulo/
*.csproj
*.unityproj
*.sln
*.suo
*.tmp
*.user
*.userprefs
*.pidb
*.booproj
*.svd
*.pdb
*.mdb
*.opendb
*.VC.db

# Unity3D generated meta files
*.pidb.meta
*.pdb.meta
*.mdb.meta

# Unity3D generated file on crash reports
sysinfo.txt

# Builds
*.apk
*.aab
*.unitypackage
*.app

# Crashlytics generated file
crashlytics-build.properties

# Packed Addressables
/[Aa]ssets/[Aa]ddressableAssetsData/*/*.bin*

# Temporary auto-generated Android Assets
/[Aa]ssets/[Ss]treamingAssets/aa.meta
/[Aa]ssets/[Ss]treamingAssets/aa/*

What each entry does

Why every line in this template is excluded, not just what it matches.

Entry Why it's excluded
/[Ll]ibrary/ A generated/local directory ([Ll]ibrary) — excluded because its contents are either build output or machine-specific state, not source you'd want to review in a diff.
/[Tt]emp/ A generated/local directory ([Tt]emp) — excluded because its contents are either build output or machine-specific state, not source you'd want to review in a diff.
/[Oo]bj/ .NET's intermediate build artifacts (MSBuild's working directory) — never meant to be shared, only regenerated.
/[Bb]uild/ Compiled/bundled output directory produced by the build tool — derived entirely from source, not source itself.
/[Bb]uilds/ A generated/local directory ([Bb]uilds) — excluded because its contents are either build output or machine-specific state, not source you'd want to review in a diff.
/[Ll]ogs/ A directory of runtime log files — same reasoning as *.log: regenerated, machine-specific, unbounded.
/[Uu]ser[Ss]ettings/ A generated/local directory ([Uu]ser[Ss]ettings) — excluded because its contents are either build output or machine-specific state, not source you'd want to review in a diff.
/[Mm]emoryCaptures/ A generated/local directory ([Mm]emoryCaptures) — excluded because its contents are either build output or machine-specific state, not source you'd want to review in a diff.
!/[Aa]ssets/**/*.meta Re-includes [Aa]ssets/**/*.meta — carves out an exception to a broader exclusion pattern above it.
[Aa]ssets/Plugins/Editor/JetBrains* Excludes [Aa]ssets/Plugins/Editor/JetBrains* — generated or machine-specific for this stack, not something to track in version control.
.vs/ Visual Studio's local solution cache (IntelliSense DB, window layout) — machine-specific and safely regenerated.
.gradle/ Gradle's local cache and build state for the project — regenerated on the next build, and can be large.
ExportedObj/ A generated/local directory (ExportedObj) — excluded because its contents are either build output or machine-specific state, not source you'd want to review in a diff.
.consulo/ A generated/local directory (.consulo) — excluded because its contents are either build output or machine-specific state, not source you'd want to review in a diff.
*.csproj Files matching *.csproj — a generated or machine-specific file type for this stack, safe to regenerate rather than track.
*.unityproj Files matching *.unityproj — a generated or machine-specific file type for this stack, safe to regenerate rather than track.
*.sln Files matching *.sln — a generated or machine-specific file type for this stack, safe to regenerate rather than track.
*.suo Visual Studio's binary per-user solution options file — machine-specific and often corrupts merges if tracked.
*.tmp Files matching *.tmp — a generated or machine-specific file type for this stack, safe to regenerate rather than track.
*.user A per-user project options file (MSBuild/Visual Studio) — overrides you don't want forced onto teammates.
*.userprefs Files matching *.userprefs — a generated or machine-specific file type for this stack, safe to regenerate rather than track.
*.pidb Files matching *.pidb — a generated or machine-specific file type for this stack, safe to regenerate rather than track.
*.booproj Files matching *.booproj — a generated or machine-specific file type for this stack, safe to regenerate rather than track.
*.svd Files matching *.svd — a generated or machine-specific file type for this stack, safe to regenerate rather than track.
*.pdb A debug symbol file generated alongside a compiled binary — build output, and can be large.
*.mdb Files matching *.mdb — a generated or machine-specific file type for this stack, safe to regenerate rather than track.
*.opendb Files matching *.opendb — a generated or machine-specific file type for this stack, safe to regenerate rather than track.
*.VC.db Files matching *.VC.db — a generated or machine-specific file type for this stack, safe to regenerate rather than track.
*.pidb.meta Files matching *.pidb.meta — a generated or machine-specific file type for this stack, safe to regenerate rather than track.
*.pdb.meta Files matching *.pdb.meta — a generated or machine-specific file type for this stack, safe to regenerate rather than track.
*.mdb.meta Files matching *.mdb.meta — a generated or machine-specific file type for this stack, safe to regenerate rather than track.
sysinfo.txt A system-info dump Unity writes when the Editor crashes — a local debugging artifact.
*.apk A compiled Android application package — build output, not source, and can be large.
*.aab A compiled Android App Bundle (Play Store's preferred format) — build output.
*.unitypackage Files matching *.unitypackage — a generated or machine-specific file type for this stack, safe to regenerate rather than track.
*.app Files matching *.app — a generated or machine-specific file type for this stack, safe to regenerate rather than track.
crashlytics-build.properties A file Unity's Crashlytics integration writes at build time — build-time-generated, not source.
/[Aa]ssets/[Aa]ddressableAssetsData/*/*.bin* Files matching /[Aa]ssets/[Aa]ddressableAssetsData/*/*.bin* — a generated or machine-specific file type for this stack, safe to regenerate rather than track.
/[Aa]ssets/[Ss]treamingAssets/aa.meta Files matching /[Aa]ssets/[Ss]treamingAssets/aa.meta — a generated or machine-specific file type for this stack, safe to regenerate rather than track.
/[Aa]ssets/[Ss]treamingAssets/aa/* Excludes /[Aa]ssets/[Ss]treamingAssets/aa/* — generated or machine-specific for this stack, not something to track in version control.