github/gitignore · Unity.gitignore
Unity .gitignore Template Explained
Why Unity.gitignore ignores Library, Temp, Obj, Build, Logs, UserSettings and auto-generated IDE files, and why .meta files must always be committed.
Unity.gitignore assumes it is placed at the root of the Unity project. The template's folder rules start with /, as in /[Ll]ibrary/, anchoring them to the project root, so if your Unity project lives in a subfolder of the repository you need to adjust the paths.
The Unity editor builds a huge cache (Library) when importing assets and also auto-generates solution files for script IDEs. This template blocks such regenerable files and helps ensure that only Assets, Packages and ProjectSettings are shared.
Rules explained
| Pattern | What it ignores and why |
|---|---|
/[Ll]ibrary//[Tt]emp//[Oo]bj//[Ll]ogs/.utmp/ | Editor caches and temp foldersAsset import results and compilation caches. They can reach several GB, and Unity rebuilds them when it opens the project. |
/[Bb]uild//[Bb]uilds/*.apk*.aab*.app*.unitypackage | Build outputPlayer builds and exported packages. Manage distribution files through releases, not the repository. |
/[Uu]ser[Ss]ettings/*.user*.userprefs*.suo.vs/ | Personal settingsEditor layout, personal settings and Visual Studio user files. |
*.csproj*.unityproj*.sln*.slnx | Auto-generated IDE filesProject and solution files that Unity regenerates every time for the script editor. If committed, paths differ per person and conflicts are frequent. |
*.pdb*.mdb*.pdb.meta*.mdb.meta | Debug symbolsMono/.NET debug information and their meta files. |
/ServerData/[Aa]ssets/StreamingAssets/aa*/[Aa]ssets/AddressableAssetsData/link.xml* | Addressables and Visual Scripting outputAddressables build output and auto-generated link files. They are recreated on every build. |
*.blend1*.blend1.metasysinfo.txtcrashlytics-build.properties/[Mm]emoryCaptures//[Rr]ecordings/ | OtherBlender backup files, crash report by-products, memory profiler captures and Recorder output. |
Practical notes
- Do not ignore
.metafiles. Unity links references between assets through the GUIDs in.meta, so if they are missing, references break in other people's projects. - Large binary assets such as textures, models and audio are usually managed with Git LFS, not gitignore.
- If you use Visual Studio or Rider, also pick the VisualStudio or JetBrains template; keeping the duplicate-removal option on cleans up overlapping rules.
Original template
Unity.gitignore
# This .gitignore file should be placed at the root of your Unity project directory## Get latest from https://github.com/github/gitignore/blob/main/Unity.gitignore## Recommended: add any editor/OS/tool-specific ignore rules from the Global/ templates as needed.# See: https://github.com/github/gitignore/tree/main/Global#.utmp//[Ll]ibrary//[Tt]emp//[Oo]bj//[Bb]uild//[Bb]uilds//[Ll]ogs//[Uu]ser[Ss]ettings/*.log# By default unity supports Blender asset imports, *.blend1 blender files do not need to be commited to version control.*.blend1*.blend1.meta# MemoryCaptures can get excessive in size.# They also could contain extremely sensitive data/[Mm]emoryCaptures/# Recordings can get excessive in size/[Rr]ecordings/# Uncomment this line if you wish to ignore the asset store tools plugin# /[Aa]ssets/AssetStoreTools*# Autogenerated Jetbrains Rider plugin/[Aa]ssets/Plugins/Editor/JetBrains*# Jetbrains Rider personal-layer settings*.DotSettings.user# Visual Studio cache directory.vs/# Gradle cache directory.gradle/# Autogenerated VS/MD/Consulo solution and project filesExportedObj/.consulo/*.csproj*.unityproj*.sln*.slnx*.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 reportssysinfo.txt# Mono auto generated filesmono_crash.*# Builds*.apk*.aab*.unitypackage*.unitypackage.meta*.app# Crashlytics generated filecrashlytics-build.properties# TestRunner generated filesInitTestScene*.unity*# Addressables default ignores, before user customizations/ServerData/[Aa]ssets/StreamingAssets/aa*/[Aa]ssets/AddressableAssetsData/link.xml*/[Aa]ssets/Addressables_Temp*# By default, Addressables content builds will generate addressables_content_state.bin# files in platform-specific subfolders, for example:# /Assets/AddressableAssetsData/OSX/addressables_content_state.bin/[Aa]ssets/AddressableAssetsData/*/*.bin*# Visual Scripting auto-generated files/[Aa]ssets/Unity.VisualScripting.Generated/VisualScripting.Flow/UnitOptions.db/[Aa]ssets/Unity.VisualScripting.Generated/VisualScripting.Flow/UnitOptions.db.meta/[Aa]ssets/Unity.VisualScripting.Generated/VisualScripting.Core/Property Providers/[Aa]ssets/Unity.VisualScripting.Generated/VisualScripting.Core/Property Providers.meta# Auto-generated scenes by play mode tests/[Aa]ssets/[Ii]nit[Tt]est[Ss]cene*.unity*# UI Toolkit auto generated files/UIElementsSchema/# Auto-generated cache in Assets folder/[Aa]ssets/[Ss]ceneDependencyCache*
Templates from github/gitignore/Unity.gitignore @356fd7b (2026-09-11) · CC0-1.0