Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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 

Thanks in advance.

share|improve this question

2 Answers 2

up vote 10 down vote accepted

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
share|improve this answer
    
Thanks! Worked like a charm! –  zhed Jul 27 '13 at 12:50

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

More information about keeping Unity Project under source control you can find in this post.

share|improve this answer
    
The URI for the link at the end looks like it has gone lost. Where did you mean it to point to? –  Anko Feb 12 at 13:15
    
Thanks for pointing on this, here is link developers.nravo.com/… –  zasadnyy Feb 13 at 16:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.