0

What is the proper use of Unity and git?

If I push the changes I made to the scenes and project, and then the other team member pull those changes, they can't properly merge the changes since the scene is a binary file.

So how can we develop on unity and use a version control as a team?

I'm on Unity 5.6.2.

0

1 Answer 1

4

You can force Unity to serialise assets and scenes as YAML text based files, this should resolve your merge issues with Git. This setting can be found under the Edit > Project Settings > Editor menu. You then set the "Asset Serialization" setting to Force Text, this will allow you to merge scenes using Unity's YAMLMerge.

Asset Serialization

Be warned, depending on the project size when changing this setting re-importing everything can take hours, and it has to be done on every client. There are other additional measures you can take to improve your workflow with Unity and Git, I'd recommend looking at this excellent post by David Douglas which goes into much more depth and teaches some of the ways you can all work on the same scene and merge your changes once you're all at your milestones.

There's also this good Unity Answers post that talks about the Pros and Cons of different asset serialisation methods that you might want to take a look at before committing to any of them.

6
  • Do you happen to have a guide that actually works on how to set up YAML merge with an external merge tool?
    – shinzou
    Commented Sep 9, 2017 at 19:54
  • Have you already looked at the official documentation page for Smart Merge that I linked in the answer? Notably the part about mergespecfile.txt docs.unity3d.com/Manual/SmartMerge.html Commented Sep 9, 2017 at 21:06
  • This is quite a good guide for setting it up as well, it talks about custom merge tools right at the beginning. gist.github.com/Ikalou/197c414d62f45a1193fd Commented Sep 9, 2017 at 21:13
  • What's in the official docs don't work.
    – shinzou
    Commented Sep 9, 2017 at 22:13
  • 1
    I think I got it to work with Kdiff like they showed in the second link. Thanks.
    – shinzou
    Commented Sep 10, 2017 at 10:19

Not the answer you're looking for? Browse other questions tagged or ask your own question.