Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Unity3D and GIT -- is it possible?

Discussion in 'Formats & External Tools' started by RalphFW, May 12, 2011.

  1. RalphFW

    RalphFW

    Joined:
    May 7, 2011
    Posts:
    18
    So, does anyone have a good guide to using Unity with GIT?

    I've had a real hell of a time trying to get Unity to work with SVN as per the instructions--mostly because of the XCode project itself. It won't compile for various weird reasons once I've checked it in to SVN. Most people seem to have moved over to GIT anyway, so I figure I'd give that a shot.

    Unity should add GIT instructions to the source control guide page:

    http://unity3d.com/support/documentation/Manual/ExternalVersionControlSystemSupport.html
     
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    It works just as well as SVN

    The main requirement is that you setup the project for CVS usage in general first by enabling it (requires pro, without pro its a nightmare).
    The stuff to exclude from versioning is the same for all version systems too, as they are meant to not be transfered as they otherwise cause trouble.

    Setting up GIT, if you are a git user is in itself trivial, I personally use SmartGIT cause it gives me a very nice interface and not a million distinct applications (without smartgit I would use mercurial, not GIT, cause its 1 app instead and also DVCS like GIT, some actually see it as even more solid thanks to options like Kiln)
     
  3. galeforcejay

    galeforcejay

    Joined:
    Nov 4, 2010
    Posts:
    4
    Agreed. Git is just as reliable to use as SVN. As dreamora said, if you have Unity Pro you will need to enable External Version Control. Here's are the contents of the .gitignore file that you can use to ensure that you are excluding the appropriate files:

    .DS_Store
    /Temp/
    /Library/assetDatabase3
    /Library/AssetServerCacheV3
    /Library/BuildPlayer.prefs
    /Library/BuildSettings.asset
    /Library/EditorSettings.asset
    /Library/EditorUserBuildSettings.asset
    /Library/FailedAssetImports.txt
    /Library/InspectorExpandedItems.asset
    /Library/MonoManager.asset
    /Library/QualitySettings.asset
    /Library/ScriptMapper
    /Library/TagManager.asset
    /Library/cache/
    /Library/guidmapper
    /Library/metadata
    /Library/ScriptAssemblies
    /Library/expandedItems
    /Library/previews
    /Library/ScriptAssemblies/Assembly-CSharp.dll
    /Library/ScriptAssemblies/Assembly-CSharp.dll.mdb
     
  4. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Sidenote: don't worry if you don't have the .DS_Store file and are on windows, thats a OSX only file generated by the finder
     
  5. sonicviz

    sonicviz

    Joined:
    May 19, 2009
    Posts:
    1,051
    Hi,
    Is there a guide for using Git as local version control system for Unity3D anywhere?
    Having some trouble getting it configured correctly with the correct sequence of central/working repositories set up on a test project.

    ty.
     
  6. nopcode

    nopcode

    Joined:
    Apr 29, 2011
    Posts:
    66
    Using Mercurial (hg) with Unity myself; it's a similar setup for using with GIT.
    The biggest problem with using Unity with a decentralized source control is that the binaries can't be merged; so if I make a change at work and then at home, Last Change Wins. Supposedly this is fixed in 3.5, but we'll see.
    I would mention that I *never* update/pull a Unity project when I have it open in Unity; some files it has open and it will barf if you try.
    In any case, the excludes list that galeforcejay listed should work. Just treat the Unity projects like you would for documentation (MSWord etc) - check in lots of binary-like stuff.
     
  7. yoyo

    yoyo

    Joined:
    Apr 16, 2010
    Posts:
    112
    We've been using git semi-successfully with a 12-person team for a number of months now. Binary files are a big pain -- scene files and prefabs can only be modified by one person at a time, since they can't be merged, and the lack of file locking in git makes this challenging. Same issue applies to art files (FBX, textures, etc.) I love git for code, but we are strongly considering moving to Subversion in order to get file locking support.

    Unity 3.5 will introduce text-based scene/asset/prefab serialization, which should make merging possible -- this will be a big step forward, but still doesn't solve the art file problem.
     
  8. nopcode

    nopcode

    Joined:
    Apr 29, 2011
    Posts:
    66
    The art-file problem is going to occur with any non-server based source control, not just GIT. If you are all working in the same office and nobody works from home, then a server-based solution is the best for you. But those of us with more dispersed teams can't be shackled to a server that may or may not be available (think metered bandwidth or just plains shoddy network connections).
     
  9. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    actually for art SVN wins cause there is a photoshop SVN addon you can buy that gives visual DIFF ... leaving only meshes and audio as being a pita

    generally if you dev on windows, I would look into a Mogware Subscription for example or something similar art focused instead of programmer focused VCS systems (git, hq, svn)