Lab 0 - Unity and Git
This assignment is due on Friday 5/11.
Complete the following steps:
- Install Git on your system, if it is not already installed.
- Create a new Unity project, or use any existing Unity project you have.
- Create a repository on GitHub Classroom here: https://classroom.github.com/a/qCa9aj7O
- Create a local repository for your Unity project.
- Push your Unity project to the GitHub repository.
- Make a change (add an object to the scene, change a prefab property, whatever)
- 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
- SourceTree by Atlassian is my personal favorite, but it’s not perfect.
- GitHub has a client called GitHub Desktop that is very fully-featured.
- GitKraken is generally liked, but is only free for non-commercial use.
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.
- GitHub is probably the most popular choice.
- I set up a GitHub Classroom so that we can create and share private repositories. Details are below.
- There is also the GitHub Student Developer Pack, that provides free private repositories along with other services.
- GitLab is an open-source competitor to GitHub that is arguably more feature-full.
- Atlassian’s BitBucket service offers free unlimited private repositories
if you sign up with an
@calpoly.edu
email address.
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 Edit → Project Settings → Editor.
- Set the Version Control - Mode to
Visible Meta Files
. - Set the Asset Serialization - Mode to
Force Text
.
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.