Lab 0 - Unity and Git

This assignment is due on Friday 5/11.

Complete the following steps:

  1. Install Git on your system, if it is not already installed.
  2. Create a new Unity project, or use any existing Unity project you have.
  3. Create a repository on GitHub Classroom here: https://classroom.github.com/a/qCa9aj7O
  4. Create a local repository for your Unity project.
  5. Push your Unity project to the GitHub repository.
  6. Make a change (add an object to the scene, change a prefab property, whatever)
  7. Commit and push your change to the repository.

Some general information about Git, as well as some specific instructions for working with Git and Unity, are provided below.

Git

Use the tutorial here to learn git: https://try.github.io/

Git is designed to be used from the command line. However, sometimes it can be easier to use a GUI.

Installation

To install Git on Linux, it’s best to use whatever package manager exists on your system.

sudo apt install git

On Mac OS, using Homebrew is easiest.

brew install git

On Windows, the best option is likely to use git for windows. Most Git GUIs will also install Git for you.

GUIs

Hosting Services

There are a number of different services that allow you to create Git repositories on the web, so that you can keep your work synchronized in one place and collaborate with teammates. Most services will let you create free repositories so long as they are open-source, but charge for private repositories. However, most places also offer free private repositories for students.

Unity

To use Unity there are a couple of steps you should take to make sure that you only check-in the necessary files, and so that it’s easier for Git to work with them.

Even following these steps, however, it’s best to make sure that only one person is working on a specific asset or scene at a time.

In repositories that you use for Unity, you should use this .gitignore file. Download that and place it in the root folder of your Unity project.

Go to EditProject SettingsEditor.

Additionally, you can watch this video which describes how to use Git and GitHub Desktop with Unity.

GitHub Classroom

I have set up a GitHub Classroom for us to use this quarter. It is essentially just a service that makes it easy to create private GitHub repositories that are shared with everyone on the team (as well as me).

By clicking this link, you will be able to create a group and a repository for your digital game.