Ignore Library and Temp correctly
Avoid multi-GB commits by excluding Unity cache directories.
Explore resourceProfessional .gitignore tools
Perfect .gitignore template for Unity projects. Ignore Library, Temp, Logs folders properly. Fix common Unity gitignore issues. Updated for Unity 2023+.
Run through this list before committing assets or builds to avoid bloated repositories.
Library/, Temp/, Logs/. If already tracked, run git rm -r --cached before recommitting.Build/, Builds/, *.apk, *.ipa after generating deliverables..meta files committed, but ignore local cache like *.pidb, Rider/VS generated files..gitignore with Unity Smart Merge or Plastic SCM workflows when using Perforce-style merges.# Unity .gitignore Template - Updated 2025 # Unity generated files [Ll]ibrary/ [Tt]emp/ [Oo]bj/ [Bb]uild/ [Bb]uilds/ [Ll]ogs/ [Uu]ser[Ss]ettings/ # Unity cache and temporary files *.tmp *.temp *.bak *.swp *~.nib *.orig *.rej # Unity crash logs CrashReports/ # Visual Studio cache files *.cache *.obj *.suo *.user *.userosscache *.sln.docstates [Dd]ebug/ [Rr]elease/ [Aa]pp_[Dd]ata/ # Unity3d generated meta files *.pidb.meta *.pdb.meta *.mdb.meta # Unity3d generated file on crash reports sysinfo.txt # MacOS .DS_Store .DS_Store? ._* .Spotlight-V100 .Trashes ehthumbs.db Thumbs.db # Windows Desktop.ini $RECYCLE.BIN/ # JetBrains IDEs .idea/ *.sln.iml # Unity Package Manager [Uu]nityPackageManager/log.txt # Unity addressables [Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin* # Unity WebGL builds WebGLBuilds/ # 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 # Unity Cloud build cloudbuild.txt # Memorypack generated files memorypack_generated/ # Rider .idea/** *.sln.iml
Library/ - Unity cacheTemp/ - Temporary filesLogs/ - Unity logsUserSettings/ - User preferencesBuild/ - Built executablesAssets/ - Your game assetsPackages/ - Package manifestProjectSettings/ - Project configuration*.unity - Scene files*.cs - Script filesIf Unity's Library folder is already in your repository, you need to remove it first:
git rm -r --cached Library/ git add .gitignore git commit -m "Remove Library folder and update gitignore"
The .gitignore file must be in your Unity project root (same level as Assets/ folder):
MyUnityProject/ āāā Assets/ āāā Library/ āāā Packages/ āāā ProjectSettings/ āāā .gitignore ā Must be here
Use both uppercase and lowercase patterns to handle different systems:[Ll]ibrary/ instead of just Library/
No, keep the Packages/manifest.json and Packages/packages-lock.json files. These define your project dependencies. However, you should ignore Packages/packages-cache/if it exists.
You're probably tracking the Library/ folder. This contains Unity's cache and can be gigabytes. Add it to .gitignore and run git rm -r --cached Library/ to remove it from tracking.
No! Meta files (.meta) are crucial for Unity. They contain import settings and asset references. Never add *.meta to your .gitignore. Only ignore specific generated meta files like *.pidb.meta.
Each Unity project needs its own .gitignore file in the project root. Unity Hub doesn't change the .gitignore requirements - each project is independent.
Avoid multi-GB commits by excluding Unity cache directories.
Explore resourceCoordinate asset folders and generated files with your team.
Explore resourceResolve Library/Temp files already tracked in Git.
Explore resourceGenerate a Unity-ready .gitignore or copy it directly into your repo.