## Unity ## | |
*.cs diff=csharp text | |
*.cginc text | |
*.shader text | |
*.mat merge=unityyamlmerge eol=lf | |
*.anim merge=unityyamlmerge eol=lf | |
*.unity merge=unityyamlmerge eol=lf | |
*.prefab merge=unityyamlmerge eol=lf | |
*.physicsMaterial2D merge=unityyamlmerge eol=lf | |
*.physicMaterial merge=unityyamlmerge eol=lf | |
*.asset merge=unityyamlmerge eol=lf | |
*.meta merge=unityyamlmerge eol=lf | |
*.controller merge=unityyamlmerge eol=lf | |
## git-lfs ## | |
#Image | |
*.jpg filter=lfs diff=lfs merge=lfs -text | |
*.jpeg filter=lfs diff=lfs merge=lfs -text | |
*.png filter=lfs diff=lfs merge=lfs -text | |
*.gif filter=lfs diff=lfs merge=lfs -text | |
*.psd filter=lfs diff=lfs merge=lfs -text | |
*.ai filter=lfs diff=lfs merge=lfs -text | |
#Audio | |
*.mp3 filter=lfs diff=lfs merge=lfs -text | |
*.wav filter=lfs diff=lfs merge=lfs -text | |
*.ogg filter=lfs diff=lfs merge=lfs -text | |
#Video | |
*.mp4 filter=lfs diff=lfs merge=lfs -text | |
*.mov filter=lfs diff=lfs merge=lfs -text | |
#3D Object | |
*.FBX filter=lfs diff=lfs merge=lfs -text | |
*.fbx filter=lfs diff=lfs merge=lfs -text | |
*.blend filter=lfs diff=lfs merge=lfs -text | |
*.obj filter=lfs diff=lfs merge=lfs -text | |
#ETC | |
*.a filter=lfs diff=lfs merge=lfs -text | |
*.exr filter=lfs diff=lfs merge=lfs -text | |
*.tga filter=lfs diff=lfs merge=lfs -text | |
*.pdf filter=lfs diff=lfs merge=lfs -text | |
*.zip filter=lfs diff=lfs merge=lfs -text | |
*.dll filter=lfs diff=lfs merge=lfs -text | |
*.unitypackage filter=lfs diff=lfs merge=lfs -text | |
*.aif filter=lfs diff=lfs merge=lfs -text | |
*.ttf filter=lfs diff=lfs merge=lfs -text | |
*.rns filter=lfs diff=lfs merge=lfs -text | |
*.reason filter=lfs diff=lfs merge=lfs -text | |
*.lxo filter=lfs diff=lfs merge=lfs -text | |
This comment has been minimized.
This comment has been minimized.
added |
This comment has been minimized.
This comment has been minimized.
Any opinions on LFS tracking |
This comment has been minimized.
This comment has been minimized.
@evitolins doesn't Unity YAML know how to handle it? |
This comment has been minimized.
This comment has been minimized.
I think my terrain .asset files were corrupted by git using this setup, I suspect the |
This comment has been minimized.
This comment has been minimized.
Right, I seemed to have fixed it by removing https://gist.github.com/anjdreas/7d203cc2b2077df5acd67b8c101c4efa |
This comment has been minimized.
This comment has been minimized.
It seems like you've incorrectly specified: physicsMaterial, it should be: physicMaterial (no s). I guess the same with the 2d variant as well. |
This comment has been minimized.
This comment has been minimized.
thanks! |
This comment has been minimized.
This comment has been minimized.
Thanks @jason-yak. Here is fork with updated physics -> physic along with some other configuration following this guide. |
This comment has been minimized.
This comment has been minimized.
I also stumbled on the terrain issue. Problem is that most .asset files in Unity are YAML but TerrainData is the only thing I know of that is binary even if you Force Text serialization. Couldn't Unity just use a different extension if it was a special case?! Oh well. |
This comment has been minimized.
This comment has been minimized.
@NPatch I was asking myself the same thing. Might be best to just stick to tracking Terrain assets in regular git? |
This comment has been minimized.
This comment has been minimized.
@NPatch @hoffmannprojects 1. If only the terrain files are the .asset that are always binary ones, which I'm not 100% sure right now (after a quick search I found a couple more binaries but were on directories like Library that are not meant to be versioned), you can save all terrains in a specific path like Assets/Terrains/** (or similar). And add it to your .gitattribute file right in this order:
2. Let git guess the type of file with:
I will probably go for the first option (if you can afford that folder structure) since it's the more flexible. |
This comment has been minimized.
This comment has been minimized.
I added .exr too. Sounds correct? |
This comment has been minimized.
This comment has been minimized.
LightingData.asset seems to be always binary. This should also be added as well I believe?
|
This comment has been minimized.
This comment has been minimized.
Noob here, is this a better version of the Unity.gitignore or a different file? |
This comment has been minimized.
This comment has been minimized.
@Dreaddisk This file is for use with Git LFS |
This comment has been minimized.
This comment has been minimized.
I see you're using:
for all On the other hand, Unity decided to use Is there a way to specify, |
This comment has been minimized.
This comment has been minimized.
Check my previous message just a little bit above in the page. I would probably go with the option 1, just because I do not really trust the ability of git to determine that. So you would like to identify the "*.assets" that are binaries and make some rules just for them. The most commons are terrains, not sure of any others. |
This comment has been minimized.
This comment has been minimized.
Some |
This comment has been minimized.
This comment has been minimized.
I have been having issues with asset files as well. Is there an updated version of this that has the rules for the common binary and text .asset types? It would be good to have one place to go for a Unity Git LFS file instead of reinventing the wheel each time. |
This comment has been minimized.
This comment has been minimized.
For people looking at limiting binary |
This comment has been minimized.
This comment has been minimized.
Looked into line ending of files with .asset extension in Force Text mode crlf
lf
Still binary with Force Text
2 cents: Leave .asset alone |
This comment has been minimized.
This comment has been minimized.
I have been digging into this as well and wanted to point out that Unity's documentation for YAMLMerge indicates it should be used only for two types of files: .unity and .prefab |
This comment has been minimized.
This comment has been minimized.
Also what's the point of treating 3D objects/Video/Audio/Image as text? They are all binary. Ofc there are in some cases, ascii versions(FBX probably has one, OBJ is by default but there's a binary version as well, though almost no one uses it). |
This comment has been minimized.
This comment has been minimized.
"-text" means non text : https://git-scm.com/docs/gitattributes |
This comment has been minimized.
This comment has been minimized.
@nemotoo My bad..thx! |
This comment has been minimized.
This comment has been minimized.
thanks for this. How would I use this with Unity assetbundles? |
This comment has been minimized.
This comment has been minimized.
@dorkbot Unfortunately, I have no idea that how to manage assetbundles with git-lfs. |
This comment has been minimized.
This comment has been minimized.
@nemotoo I see you use merge=unityyamlmerge to let git use unityyamlmerge for one type of files, How to let git know the unityyamlmerge tool? I like your way to set unityyamlmerge for specified files. |
This comment has been minimized.
This comment has been minimized.
I agree with @evitolins what about tracking I have very large scenes over 100mb and Github is complaining about it. Without talking about lighting datas...
But now will the yaml "smart merge" still work? |
This comment has been minimized.
Nice one. Thank you I'll use it to start.