10
\$\begingroup\$

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.

\$\endgroup\$

2 Answers 2

12
\$\begingroup\$

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
\$\endgroup\$
0
3
\$\begingroup\$

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.

\$\endgroup\$
3
  • \$\begingroup\$ The URI for the link at the end looks like it has gone lost. Where did you mean it to point to? \$\endgroup\$
    – Anko
    Feb 12, 2014 at 13:15
  • \$\begingroup\$ Thanks for pointing on this, here is link developers.nravo.com/… \$\endgroup\$
    – zasadnyy
    Feb 13, 2014 at 16:45
  • \$\begingroup\$ it's not a direct answer to this question but thanks for mentioning "Force Text" serialization because it's useful for version control \$\endgroup\$
    – jhocking
    Jan 21, 2015 at 23:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .