Search code examples
unity-game-enginegithubversion-controlmissing-dataprefab

Unity Prefabs missing after pulling project from GitHub


I started to make a project on a Windows computer and uploaded it via GitHub. Later I wanted to download it on my Mac. But when I start the project on MacOS Unity the scene is empty and all prefabs are missing. Every time when I check GitHub it is deleting a lots of meta.files. When I discard the deletion, all meta.files are deleted again as soon as I start the project on my Mac.

Getting back to Windows GitHub says that everything is pushed. Referring to that article (https://medium.com/codex/solving-the-missing-prefab-issue-in-unity3d-ae5ba0a15ee9) the problem appears similar. But the solution does not help.

What is the problem to get my project from Windows to Mac via GitHub?


Solution

  • "Unity deletes .meta files": After some research the answer to this seems to be - Unity removes .meta files when the corresponding object is missing.

    "Prefabs are missing": GitHub on my windows computer did not commit the .obj files. It took me a while to figure out that somehow a "gitignore_global.txt" was installed from somewhere (maybe GitHub Desktop?). .obj files were included to be ignored. That "gitignore_global.txt" is located in:[x:/User/Documents]

    If you face the same problem - check the gitignore-file in your Unity project too. If certain file types are prohibited via one of these 2 files - no chance!

    Cheers