# This .gitattributes file is designed for Unity projects. # It configures Git LFS for large binary files and sets up # proper merging for Unity's text-based assets. # # Unity Project Settings # # Before using this file, ensure your Unity project is configured for # version control (these are default in modern Unity versions): # 1. Go to Edit > Project Settings > Editor # 2. Set Version Control Mode to "Visible Meta Files" # 3. Set Asset Serialization Mode to "Force Text" # # # Macro Definitions # # These macros simplify the file and make it easier to read and maintain. # [attr]unityyaml -text merge=unityyamlmerge [attr]lfs -text filter=lfs diff=lfs merge=lfs lockable # # Unity's Core Text-Based Assets # # These files are text-based YAML and should be handled by Git. # The 'unityyamlmerge' tool can be used to intelligently merge them. # *.unity unityyaml *.prefab unityyaml *.mat unityyaml *.anim unityyaml *.controller unityyaml *.overrideController unityyaml *.asset unityyaml *.meta unityyaml *.scenecafe unityyaml *.playable unityyaml *.timeline unityyaml *.mask unityyaml *.GUISkin unityyaml *.preset unityyaml # # Scripts and UI Documents # *.asmdef -text *.asmref -text *.tss -text *.uss -text *.uxml -text # # Modern Unity System Assets (Text-Based) # # Files for newer systems like Shader Graph and the Input System. # These are text-based (JSON/YAML) and should be versioned as text. # *.shadergraph unityyaml *.shadersubgraph unityyaml *.inputactions -text # # Binary Assets (Tracked with Git LFS) # # These are common binary file types used in game development. # They are tracked with LFS to keep the core repository size small. # # 3D Models *.fbx lfs *.obj lfs *.3ds lfs *.blend lfs *.dae lfs *.max lfs *.ma lfs *.mb lfs # Textures *.png lfs *.jpg lfs *.jpeg lfs *.gif lfs *.bmp lfs *.tga lfs *.tif lfs *.tiff lfs *.psd lfs *.exr lfs *.hdr lfs *.dds lfs # Audio *.wav lfs *.mp3 lfs *.ogg lfs *.aif lfs *.aiff lfs # Video *.mp4 lfs *.mov lfs *.avi lfs *.wmv lfs *.webm lfs # Fonts *.ttf lfs *.otf lfs # Other Binary Assets *.bytes lfs *.unitypackage lfs *.dll lfs *.so lfs *.bundle lfs *.a lfs *.pdf lfs *.zip lfs *.rar lfs *.7z lfs # # Handling Ambiguous `.asset` Files (Binary Assets) # # The .asset extension is used for both text-based ScriptableObjects # and binary assets like TerrainData, LightingData and NavMeshData. # The `*.asset unityyaml` rule above treats all .asset files as text by default. # # For binary .asset files, you MUST add more specific rules below this section. # Git applies the LAST matching rule, so these specific rules will override the general one. # # It is a best practice to use a clear naming convention for these. # *Terrain.asset lfs *LightingData.asset lfs NavMeshData.asset lfs # If you have a different naming convention, adjust accordingly. For example: # *[Tt]errain*.asset lfs