Philly Game Jam 2012 [Part 1 - Preparation]

I want to avoid pitfalls our team ran into last year. One of those pitfalls was source control with Unity. Unity 3.5.x has enabled people like me with only the free version of Unity and no Asset Server to use External Versioning tools, in this case, Git. I like Git, it’s really simple to learn and it has a cool community via Github. Setting up takes a few steps.

In Unity, after opening an existing project or creating a new project go to Edit > Project Settings > Editor
unity_1

In the Inspector for Editor Settings change Version Control Mode to Meta Files.
image

After doing this close the project and delete the Library folder under the Unity Project folder. Then reload the project. I created a .gitignore file to ignore the files I don’t want to add as part of the .git repository to the Unity Project folder. It’s based on this one by Macy Kuang.
Now I can add the project to Git using Git Bash:

user@USER-PC /C/Users/user
$ cd MYUNITYPROJECT

user@USER-PC /C/Users/user /MYUNITYPROJECT
$ git init

user@USER-PC /C/Users/user /MYUNITYPROJECT (master)
$ git add –all

user@USER-PC /C/Users/user /MYUNITYPROJECT (master)
git commit ‘initial commit’

And that’s all there is to it!

A collaborator needs to just clone this repository, wherever it’s located and open the project with Unity and it will build all the missing temporary folders.

References
http://unity3d.com/support/documentation/Manual/ExternalVersionControlSystemSupport
http://macykuang.com/?p=182

Share on FacebookShare on Twitter