# problem with git on a unity project

I tried to version control my project folder with git. When it came to pull the project from the repository, though, something went wrong: apparently scripts are missing and the prefabs and kind of all the graphical elements appear to be pinkish. Does anybody know how to fix this?

This is the .gitignore I'm using at the moment:

Temp/
Obj/
UnityGenerated/
Library/

ExportedObj/
*.svd
*.userprefs
*.csproj
*.pidb
*.suo
*.sln
*.user
*.unityproj
*.booproj

.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
Icon?
ehthumbs.db
Thumbs.db


Go to Edit -> Project Settings -> Editor and make sure that the Version Control Mode property is set to Meta Files, not Disabled.

Starting from Unity 4.2 you can also set the Asset Serialization Mode property to Force Text without needing a Pro license, which is supposed to work better with version control too.

And here is the gitignore that I use:

[Ll]ibrary/
[Tt]emp/
[Oo]bj/

# Autogenerated VS/MD solution and project files
*.csproj
*.unityproj
*.sln
*.apk
*.sln.DotSettings.user
*.suo
*.userprefs
*.pidb


Since Unity 4.3 you also have to enable External option from preferences, so full setup process looks like:

1. Enable External option in Edit(or Unity on Mac) → Preferences → Packages → Repository
2. Switch to Hidden Meta Files in Edit → Project Settings → Editor → Version Control Mode
3. Switch to Force Text in Edit → Project Settings → Editor → Asset Serialization Mode
4. Save scene and project from File menu