Home git How to use GIT to control versions in unity3d?

How to use GIT to control versions in unity3d?




How is the most easy to use git when working with unity, considering, in particular, binary Unity projects? Please describe the workflow, specify that it is necessary to include in .gitignore , what settings to choose in Unity and / or project and what else do you need to consider?

Note : I understand that Unity developers are recommended to use Asset Server , but, for a number of reasons, I would like to use Git, that is, use ASSET Server – for me Not an option.

Question translation How to Use Git for Unity Source Control? @ Pressingonalways .

Answer 1, Authority 100%

Recommendations below are an excerpt from personal blog .

Using GIT for 3D games

Note: Not so long ago, GitHub released a plugin for GIT called Git LFS , allowing solve the problem described. Now you can easily and effectively monitor versions for bulk binary files!

Git works perfectly with 3D games, with the exception of one: Saving versions of large (& gt; 5 Mb) media files for a long time (when updating versions archives) may be problematic. We solved this problem in our projects fixation of only those binary files that are considered final . Our 3D artists use Dropbox to work with WIP – And on the above reason, and because it is much faster and easier (not many artists are faster Work with Git!).

work procedure with git

a specific procedure for working with GIT to a greater extent depends on your own preferences, as well as the experience and traditions of your teamwork. However, I would strongly recommended a methodology with the “speaking” name “Git Flow in the original version of the author .

I will not be too deepened in the essence of the methodology, since the author perfectly described it – besides, without excessive “water”, so it is not difficult to understand it. I have been using this method for some time for my team and at the moment it is the best methodology from all of us tried.

Git Gui Client Application

This is, in fact, from the area of ​​personal preferences, because with regard to the graphical interface for Git, there is a choice of choice, including whether the graphical interface is used at all. I have a hurry to offer free SourceTree application , since it is perfectly combined with the Git Flow extension. In SourceTree guide You can read about the implementation of the Git Flow methodology in this application.

What to ignore in Unity3D when working with Git

# =============== #
# Unity generated #
# =============== #
Library /

# =====================================
# Visual Studio / Monodevelop Generated #
# =====================================
Exportedobj /
* .svd.
* .userprefs.
* .pidb.
* .suo.
* .user.
* .UnityProj.
* .booproj.

# ============ #
# Os Generated #
# ============ #
._ *

Unity3D settings for working with Git

for unity3d V4.3 and above:

  1. (for v4.5 and higher skip this step) Select EXTERNAL in Unity → Preferences → Packages → Repository .
  2. Use Visible Meta Files in Edit → Project Settings → Editor → Version Control Mode .
  3. Use Force Text in Edit → Project Settings → Editor → Asset Serialization Mode .
  4. Save the scene and project from the File menu.


One of the negative aspects of using Unity3D and Git is that Git doesn’t care about empty folders (and Unity creates meta files for them). As a result, unnecessary conflicts may arise.

For a solution, add custom handler to the / folder .git / hooks / project repository. Thanks to the handler, after every project update (pull / merge), Git will check for deleted files as well as empty folders.

Translation of the answer How to use Git for Unity source control? @S.Richmond .

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions