Start Using Git for Your AR Project

Design your Unity AR project efficiently with Git. Learn the essentials of version control, collaboration, and using .gitignore and .gitattributes files.

Are you new to Git for Unity development? Dive in with the help of Git-it Electron, an excellent tool for learning Git and GitHub through hands-on challenges. Understanding version control is essential for Unity developers. It enables efficient project management, collaboration, and change tracking. With Git-it, you'll establish a solid foundation in version control, making your Unity development process smoother and more organized.

Understanding .gitignore

The .gitignore file defines which files Git should ignore, ensuring they are not versioned. This often includes: 

  • Secrets to maintain project security.

  • Personal settings in the IDE or Unity Editor.

  • Files generated by Unity, like the entire Library folder.

This approach keeps your repository clean and portable, containing only the essential files necessary for project collaboration.

What is .gitattributes?

The .gitattributes file defines what files or file types will be stored through Git Large File Storage (LFS). Git LFS was created to handle files larger than 100MB, which the classic Git system can't manage. In Unity projects, large files like models, music, textures, and sometimes even scenes are stored using Git LFS. These files are stored outside the repository, with only references kept in the repository.

Getting Started

Download our .gitignore and .gitattributes files, which we use as a starting point for every new Unity project. Both files should be placed in the root of your repository where Git is initialized and need to be committed. The paths listed in these files are relative to the location of the files and, therefore, relative to the repository root.

For a customized .gitignore file, you can use a tool like Toptal's Gitignore Generator. This tool can generate a file based on specific tags (e.g., Unity, Rider, or other IDEs) that you use.

Why Use Git for Unity?

Efficient Collaboration

Git allows multiple developers to work on the same project simultaneously.

Version Tracking 

Easily track changes and revert to previous versions if needed.

Organized Workflow 

Structured project management, even with large files, thanks to Git LFS.

Biggest community

If you need help, there is a Stack Overflow response for everything. Chat GPT works here as well. Furthermore, almost every software developer knows how Git works, which is great for onboarding and outsourcing development efforts.

It is free and open source

You can get free version control with the command line and some Git clients like GitHub Desktop, combined with the free tiers that cloud providers like GitHub offer.

‍There are so many tools, scripts, and add-ons for Git. You can extend it with your own tools if you wish.

Git clients and cloud services are available at reasonable prices

‍You have plenty of choice when it comes to your toolset that is based on Git, including desktop apps and cloud services. Remember, GitHub is also based on Git. Everything is compatible with each other and you are not locked in.

Works offline

‍You don't need to worry when your internet connection is interrupted.

It's fast

‍Creating new branches and merging them happens instantly. Also, committing (creating new versions) is way faster than in Perforce because you don't need to wait until the files are uploaded to the server. Git puts them in the local cache and uploads them in the background while you can continue working.

Consider tools like Anchorpoint for Enhanced Workflow

As you explore Git for Unity development, you can get to a point where managing a lot of 3D assets across the team can be challenging. Consider Anchorpoint as a tool aimed at 3D artists. It offers a user-friendly interface that integrates with Git, making collaboration and version control more intuitive, especially when dealing with large assets common in Unity projects. They have a great article comparing various version control systems.

Want to discuss this or other topics with us? Join our Discord community or write us an email.

Text by:

Pavel

Published on

Dec 12, 2024

Share this article

augg.io s.r.o. • Světova 523/1, 180 00, Praha 8, Czech Republic • IČ: 173 94 155

©augg.io s.r.o, all rights reserved

This project was implemented with the financial support of the Technology Incubation Programme.

augg.io s.r.o.
Světova 523/1, 180 00,

Praha 8, Czech Republic

IČ: 173 94 155

©augg.io s.r.o, all rights reserved

This project was implemented with the financial support of the Technology Incubation Programme.

augg.io s.r.o. • Světova 523/1, 180 00, Praha 8,
Czech Republic • IČ: 173 94 155

©augg.io s.r.o, all rights reserved

This project was implemented with the financial support of the Technology Incubation Programme.