The recommendations below are excerpts from a personal blog .
Using Git for 3D games
Note: Not so long ago, GitHub released a plugin for Git called Git LFS to solve this problem. Now you can easily and effectively perform version control for bulk binary files!
Git works great with 3D games, except for one thing: saving versions of large (> 5 MB) media files for a long time (when updating version archives) can be problematic. We solved this problem in our projects by fixing only those binary files that are considered final . Our 3D artists use Dropbox to work with WIP - and for the above reason, and because it is much faster and easier (not many artists are eager to work with Git!).
Git workflow
The specific procedure for working with Git is more dependent on your own preferences, as well as the experience and traditions of your teamwork. Nevertheless, I would strongly recommend a methodology with the “talking” name “ Git Flow ” in the original version of the author .
I will not delve too deeply into the essence of the methodology, since the author described it perfectly well - besides, without too much “water,” so it is not difficult to understand it. I have been using this method for my team for some time and at the moment it is the best methodology we have ever tried.
Git GUI client application
This is, in fact, from the area of ​​personal preference, because with regard to the graphical interface for Git, there is a choice, including the choice of whether to use the graphical interface at all. I hasten to offer the free SourceTree application , as it is perfectly combined with the Git Flow extension. In the SourceTree tutorial, you can read about the implementation of the Git Flow methodology within this application.
What to ignore in Unity3D when working with Git
# =============== # # Unity generated # # =============== # Temp/ Library/ # ===================================== # # Visual Studio / MonoDevelop generated # # ===================================== # ExportedObj/ obj/ *.svd *.userprefs /*.csproj *.pidb *.suo /*.sln *.user *.unityproj *.booproj # ============ # # OS generated # # ============ # .DS_Store .DS_Store? ._* .Spotlight-V100 .Trashes ehthumbs.db Thumbs.db
Unity3D settings for working with Git
For Unity3D v4.3 and higher:
- (For v4.5 and above, skip this step) Select the
External option in Unity → Preferences → Packages → Repository . - Use
Visible Meta Files in Edit → Project Settings → Editor → Version Control Mode . - Use
Force Text in Edit → Project Settings → Editor → Asset Serialization Mode . - Save the scene and project from the
File menu.
Additionally
One of the negative aspects of using Unity3D and Git is that Git does not care about empty folders (and Unity creates meta files for them). As a result, unnecessary conflicts may arise.
To solve this, add a special handler to the /.git/hooks/ folder of the project repository. Thanks to the handler, after each update of the project (pull / merge), Git will check for deleted files, as well as empty folders.
Translation of an answer How to use Git for Unity source control? @ S. Richmond .