Using SVN Or Other Version Control With Unity

Okay, finally figured out how to get Unity 3D (non-Pro) to work with source control. Here’s the steps.

First, in your project, you need to switch to metadata mode. This creates external text files that allows your in-scene objects to stay linked to their prefabs. So unless you like seeing a bunch of red objects in your project hierarchy after committing, go to Edit->Project Settings->Editor. In the inspector pane, change the Version Control Mode to “Meta Files”. You will have to do this for each project you create, unfortunately.

Save your project so Unity can create the metadata files.

Now, commit your project folder to your version control repository except the Library sub-folder. Indeed, if your version control supports marking folders as “Ignored”, do that for the Library folder. There are no assets in this folder and If it gets deleted Unity just recreates it on next project load anyway.

Now, you should be able to delete your local folder entirely, pull down the version from source control and open it in Unity, where it should look just like you left it. Needless to say, I would recommend doing this with a test project first.

Finally, you must remember to add all assets you import or create to the repository on subsequent check-ins.

This should allow you to keep a working copy of your Unity project in a safe place and under source control.