- Home /
Too subjective and argumentative
Does Git or SVN work better with Unity?
Does anybody have an opinion whether GIT or SVN works better with Unity? From what I gathered Unity's Asset server is the best way to go but we can't really spend the money on that right now. We're using Unity Pro and just put our first real project under SVN, but we're already running into some trouble. Before we expend too much effort I wanted to check and see if maybe GIT would be a better choice than SVN.
Thanks, Geoff
Forget git, because it can not handle empty folders - so that's the end of it. Further, git is just not made for large binaries, and it handles folders and deletions badly in general. Get an SVN repo at xp-dev.com (or similar). On a $$anonymous$$ac use "Versions" (versionsapp.com). On Windows use Tortoise. Don't forget to turn on meta files. Note that of course, obviously, you never put the Library/ older under version control, at all. (Any more than you'd version control binaries.)
@Geoff, could you please accept answer to close this question? Or you still need more information?
Answer by StephanK · Apr 02, 2011 at 08:24 AM
I haven't tried GIT yet with Unity, but the general problems will be the same with every versioning system. (including Asset Server) There is just no intelligent way to merge binary files (assets, scenes etc.). So in the end it comes down to which versioning system you are comfortable with.
Precisely, you cannot, of course, literally version control binaries. Game production is simply about large binaries. svn "stores" them fine.
It should be noted that you can easily force Unity to store all its assets as text, not binary (ProjectSettings=>Editor=>AssetSerialization). It's quite messy to merge these YA$$anonymous$$L files, however, but it's still better than to just dump complete binaries into the database. Also, Unity seems to provide something called "Smart$$anonymous$$erge" which explicitly is supposed to help you with YA$$anonymous$$L merging: http://docs.unity3d.com/$$anonymous$$anual/Smart$$anonymous$$erge.html
right, by all means you can use the text serialisation if desired.
Answer by Zib Redlektab · Apr 02, 2011 at 04:49 PM
SVN kind of sucks, from personal experience, and something like Git or Mercurial is much better. Again, it's entirely personal preference, but check out this article for more info: http://hginit.com/00.html
As for working with Unity, the big problem (besides not being able to merge Binary files) with not having Unity Pro is that the Library directory is crazy.
NOTE - this answer is for historic value only. With Unity you DO NOT, AT ALL, put the Library folder under version control.
There's all sorts of meta files and stuff that change every time you work in the Unity interface, and it will all be different every time you check in changes. And you need those differences on everyone's computer, or things will break.
My team's solution is pretty basic: every time you check in changes, make a zip file of the Library, and check that in instead of the Library itself. You just need to remember to re-zip every time you commit, and unzip every time you update. Otherwise, it works like a charm. :)
$$anonymous$$y main concern with SVN is that it's terrible at folders. If you delete or move a folder through the editor before making the change in SVN it just goes to pieces. Since Unity organization is so folder driven and SVN being twitchy it been a source of friction. I'm wondering if Git is any better with folders. I should probably investigate that over at StackOverflow.
This is probably the best solution I can think of regarding the binary files at this moment in time. Good call Zib!
I realize this answer is quite old, but I think it would be important and helpful to include some more up-to-date information.
You can quite easily have Unity store all its assets (scenes, prefabs, materials, ...) as text version, which can (depending on the amount of changes) be merged and modified. At least the Asset Server compresses files before transfer, so the additional size due to storing stuff as text is not problematic
You never need anything in the Library folder, at least not since they made the .meta files mandatory (which are hidden by default, but reside in the Assets folder). All you need is in the Assets folder, plus the ProjectSettings
Answer by kristercollin · Aug 30, 2012 at 05:05 AM
I'm currently using SVN with my unity projects through Windows' TortoiseSVN and I actually find that it works exactly as it should. I agree that SVN can get twitchy and easily freakout at times, but tortoiseSVN has the flexibility to accept the kinds of changes that you will have to make in your Unity project without going nuts (though, I am certain I'd have had a very different experience with this if I were still using command line SVN).
If you've run into trouble, I'd make sure that you've followed this guide, then you should be perfectly set up to get underway: http://docs.unity3d.com/Documentation/Manual/ExternalVersionControlSystemSupport.html
Of course, as has been said, it's all personal preference, as they both work well and face the same general challenges (merging binary files, etc). I'm only using SVN because I rolled out my own repository server and SVN filled all my needs for that to function. If you like Git more, then it'll work just as well (except that Git is extremely fast).
Sure. Note that on $$anonymous$$ac realistically you have to annoyingly use versionsapp, which unfortunately cost a few bucks.
Answer by viktorcpp · Sep 01, 2011 at 09:30 AM
It seems that Unity2d can not work properly with SVN or GIT. The problem of dirty unity3d-зroject structure. Perhaps the unity3d-authors are not familiar with any version control systems ((
p.s.: asset server almost nothing can((
This is completely wrong. Some brand-new users may not realise that (of course) you do not version control the Library/ folder. (No more amazing than that you do not version control binary builds when working with c.) Version control, with subversion, works utterly perfectly with Unity; the entire game industry runs on it. Every freelance job you ever get you'll just be given the keys to a svn repo.
Answer by Sisso · Aug 30, 2012 at 02:59 AM
Git is better and it works.
There is some info on google. The shortest: http://forum.unity3d.com/threads/141420-Unity-and-Git
Git doesn't handle empty folders and, of course, is useless with binaries especially large binaries). This is the simple reason you will generally find subversion being used when you are working on a Unity project. Git is fantastic for what it is built for .. literally SOURCE (ie, "c files") handling.
As Sisso mentions if, unusually, you want to use git with Unity (perhaps because you're used to using git when working with SOURCE control, that is to say when working with TEXT FILES), then go to for example the linked page and start working through the various approaches to getting git to work with Unity (in as much as the first thing it says on the git tin is "this is for text files, don't use with binaries" - !!)
Alternately, get the password for the svn repo, and remember of course you don't save the Library/ folder with Unity.
Git is for SOURCE control. Being a game developer has almost nothing to do with SOURC$$anonymous$$ it's about huge video, music, image and 3D model files. It would be like working in a TV commercial production studio, and wanting to use git - it's not really a thing.
After this statement "everyone uses subversion for Unity" I think that you lose all your credibility.
The question is subjective and argumentative, not to mention old. Both platforms have moved and developed. Your statement is a little strong, in my opinion :)