Unity Git and Scenes

I’ve been keeping all my code on Github, branching and merging with each major step.

Today I pulled the Master Branch down and put it on my other machine, the test scene that had a full setup is now blank. Scipts, pre-fabs, tools, art and all the standard stuff are there. I’m pushing everything to GitHub, what in the hell is going on?

Is there a set of steps I need to take when checking in and pushing a branch to make sure this doesn’t happen again?

Here is my .gitignore file:

Add any directories, files, or patterns you don’t want to be tracked by version control

/

emp/
/[Ll]ibrary/
/[Bb]uild/
/[Oo]bj/
*.tmp
*.user
*.userprefs
*.pidb
*.booproj
*.lock
UnityLockFile*
UnityTempFile*
sysinfo.txt

Any help would be appreciated, that was a lot of work just gone...

That looks like a good .gitignore to me.

Seems like you’ve got this covered, but it is very important you DO commit .meta files and DON’T commit the Library folder.

When your scene randomly loses all of it’s references, try closing the project, deleting the Library folder (and Temp folder if it exists), then re-launch the project. If that doesn’t work, re-clone the project from the server.

If all else fails, try re-cloning the project on the original machine. If the re-clone fails on the original machine, there is something wrong with how you’ve committed the project in git. If it does work on the original machine, there is probably something wrong with your install of Unity on your second machine.

Good luck!