Skip to content

Instantly share code, notes, and snippets.

@vivi90
Created May 30, 2021 16:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vivi90/14d291b83b4397b2812502b41f700058 to your computer and use it in GitHub Desktop.
Save vivi90/14d291b83b4397b2812502b41f700058 to your computer and use it in GitHub Desktop.
.gitattributes file for Unity projects
# Modified from:
# https://hextantstudios.com/unity-gitattributes
# Macro for Unity YAML-based asset files.
[attr]unityyaml -text merge=unityyamlmerge diff
# Macro for all binary files that should use Git LFS.
[attr]lfs -text filter=lfs diff=lfs merge=lfs lockable
# Default to auto-normalized line endings.
* text=auto
# Code
*.[cC][sS] text diff=csharp
# Unity text assets
*.meta unityyaml
*.unity unityyaml
*.asset unityyaml
*.prefab unityyaml
*.mat unityyaml
*.anim unityyaml
*.controller unityyaml
*.overrideController unityyaml
*.physicMaterial unityyaml
*.physicsMaterial2D unityyaml
*.playable unityyaml
*.mask unityyaml
*.brush unityyaml
*.flare unityyaml
*.fontsettings unityyaml
*.guiskin unityyaml
*.giparams unityyaml
*.renderTexture unityyaml
*.spriteatlas unityyaml
*.terrainlayer unityyaml
*.mixer unityyaml
*.shadervariants unityyaml
*.preset unityyaml
*.asmdef -text diff
*.cginc text
*.shader text
# Unity binary assets
*.cubemap lfs
*.unitypackage lfs
# Note: Unity terrain assets must have "Terrain" suffix.
*Terrain.asset -unityyaml lfs
# Note: Unity navmesh assets must have "NavMesh" suffix.
*NavMesh.asset -unityyaml lfs
# Images
*.[jJ][pP][gG] lfs
*.[jJ][pP][eE][gG] lfs
*.[pP][nN][gG] lfs
*.[aA][pP][nN][gG] lfs
*.[aA][tT][sS][cC] lfs
*.[gG][iI][fF] lfs
*.[bB][mM][pP] lfs
*.[eE][xX][rR] lfs
*.[tT][gG][aA] lfs
*.[tT][iI][fF] lfs
*.[tT][iI][fF][fF] lfs
*.[iI][fF][fF] lfs
*.[pP][iI][cC][tT] lfs
*.[dD][dD][sS] lfs
*.[xX][cC][fF] lfs
*.[lL][eE][oO] lfs
*.[kK][rR][aA] lfs
*.[kK][pP][pP] lfs
*.[cC][lL][iI][pP] lfs
*.[wW][eE][bB][mM] lfs
*.[wW][eE][bB][pP] lfs
*.[sS][vV][gG] lfs
*.[sS][vV][gG][zZ] lfs
*.[pP][sS][dD] lfs
*.[aA][iI] lfs
*.[aA][fF][pP][hH][oO][tT][oO] lfs
*.[aA][fF][dD][eE][sS][iI][gG][nN] lfs
*.[kK][rR][aA] lfs
*.[eE][xX][rR] filter=lfs diff=lfs merge=lfs -text
*.[hH][dD][rR] filter=lfs diff=lfs merge=lfs -text
*.[lL][xX][oO] filter=lfs diff=lfs merge=lfs -text
# Audio
*.[mM][pP]3 lfs
*.[oO][gG][gG] lfs
*.[wW][aA][vV] lfs
*.[aA][iI][fF] lfs
*.[aA][iI][fF][fF] lfs
*.[mM][oO][dD] lfs
*.[iI][tT] lfs
*.[sS]3[mM] lfs
*.[xX][mM] lfs
*.[rR][nN][sS] filter=lfs diff=lfs merge=lfs -text
*.[rR][eE][aA][sS][oO][nN] filter=lfs diff=lfs merge=lfs -text
# Video
*.[mM][oO][vV] lfs
*.[aA][vV][iI] lfs
*.[aA][sS][fF] lfs
*.[mM][pP][gG] lfs
*.[mM][pP][eE][gG] lfs
*.[mM][pP]4 lfs
*.[fF][lL][vV] lfs
*.[oO][gG][vV] lfs
*.[wW][mM][vV] lfs
# 3D objects
*.[fF][bB][xX] lfs
*.[oO][bB][jJ] lfs
*.[mM][aA][xX] lfs
*.[bB][lL][eE][nN][dD] lfs
*.[bB][lL][eE][nN][dD][eE][rR] lfs
*.[dD][aA][eE] text
*.[mM][aA] lfs
*.[mM][bB] lfs
*.3[dD][sS] lfs
*.[dD][fF][xX] lfs
*.[cC]4[dD] lfs
*.[lL][wW][oO] lfs
*.[lL][wW][oO]2 lfs
*.[aA][bB][cC] lfs
*.3[dD][mM] lfs
*.[bB][iI][nN] lfs
*.[gG][lL][bB] lfs
*.[oO][xX][pP] lfs
*.[sS][tT][lL] text
*.[mM][eE][sS][hH] lfs
*.[uU][sS][dD] lfs
# Fonts
*.[oO][tT][fF] lfs
*.[tT][tT][fF] lfs
# Executables
*.[dD][lL][lL] lfs
*.[sS][oO] lfs
*.[aA]
*.[pP][dD][bB] lfs
*.[mM][dD][bB] lfs
# Debug symbols
*.debug
# Packaging
*.[bB][zZ]2 lfs
*.[xX][zZ] lfs
*.[zZ][iI][pP] lfs
*.7[zZ] lfs
*.[gG][zZ] lfs
*.[rR][aA][rR] lfs
*.[tT][aA][rR] lfs
# Documents
*.[pP][dD][fF]
# Collapse Unity-generated files on GitHub
# Source: https://thoughtbot.com/blog/how-to-git-with-unity
*.asset linguist-generated
*.mat linguist-generated
*.meta linguist-generated
*.prefab linguist-generated
*.unity linguist-generated
@vivi90
Copy link
Author

vivi90 commented May 30, 2021

Assumes *.dae and *.stl files to be saved as plain text.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment