- Home /
Visible or hidden meta files with Git?
Hi! I'm setting up a Unity project using Git as an external version control system.
I started by reading a tutorial provided by Unity, which suggests using hidden meta files: http://unity3d.com/learn/tutorials/modules/beginner/architecture/folders-in-version-control
However, the Unity documentation clearly suggests using visible meta files: http://docs.unity3d.com/Manual/ExternalVersionControlSystemSupport.html
So, which one would be the most recommended option to choose, visible or hidden meta files, especially now with Unity 5?
Answer by ThomasVandenberghe · Mar 25, 2015 at 04:44 PM
Use visible meta files, and commit them in GIT, if you don't do this, the next person or computer who gets the solution will generate new meta files because it can't find any.
Each meta file has a certain guid which is used to reference to the correct assets. The next time anything searches for this reference, it won't be found and your scene will be broken.
For scripts you will get something like "Missing script"
Thank you for explaining this. I have not been committing *.meta because all the .gitignore templates I saw showed ignoring them, and I have been having all kinds of issues like you mentioned of missing scripts, etc.
having the same question,thanks for the answer,helps a lot!
While $$anonymous$$Vandenberghe's answer is absolutely right, metas for some file types can be added to gitignore. For example adding .aar.meta or .jar.meta to gitignore is safe because Unity don't reference android and java archives directly from editor and do not add any configuration to those files
They do however store wether the .jar or .aar files need to be included in specified build targets, so I would advice against ignore any meta files. Default they will be set to android only, but I have cases in which certain files shouldn't be included because they clash with other plugins which include the same files resulting in a dex build error.
Sad but true. Thank you for pointing this thing out. By the way, that thing, I mean the clash with other plugins. It's why I prefer managing aar/jar files of native plugins in one place for android - in Assets/Plugins/Android/mainTemplate.gradle (which will be used as base for generating Temp/gradleOut/build.gradle - main build file) It's good for version aligning too. Good thing that unity added gradle build support with all those modern plugins with many dependencies like Firebase
Your answer
Follow this Question
Related Questions
UnityYAMLMerge: File is not a valid text serialization YAML file 1 Answer
Error and conflict on meta files on repository and my pc 0 Answers
How to fix /Library/ conflicts in GitHub repo for Unity project? 1 Answer
Meta files: What is the "fileFormatVersion"? 1 Answer
SmartMerge with TortoiseSVN 1 Answer