Project 0: Spinning Cube

Part 5: Generating Your Submission for ELMs

Generating the Zip File with Git

There are many reasons why we would want to use Git to zip our project rather than doing it directly, the most important of which is to ignore the numerous extra unnecessary files generated by Unity. We’ll go over these in more detail in the last section.

First, download and copy the two files from here (.gitignore and .gitattributes) into the root folder of your project (i.e. the folder that contains folders with the names “Assets”, “Builds”, “ProjectSettings”, etc.).

Next, open up your terminal and navigate to this same folder. Then enter the following command to initialize a new git repo for this project.

> git init
Initialized empty Git repository in [LOCATION OF YOUR PROJECT]/Spinning Cube/.git/

Now let’s set up the repo to make use of Git Large File Storage (LFS). By default, Git doesn’t really work well or efficiently with binary files (i.e. any non-text-based file like images, sounds, 3D models, etc.), but Git LFS fixes this. The .gitattributes file that you added to your project folder at the start of this step defines the files that should be tracked with Git LFS.

Type in the following command so that the repo can use Git LFS.

> git lfs install
Updated git hooks.
Git LFS initialized.

At this point, you will want to add and commit your project to the repo. Note that you must add a message in order to successfully commit in git. The example below has the message “Added project”.

> git add --all
> git commit -am "Added project"

The final command you should enter is listed below. This will create a zip file containing only the necessary files for the project, following the rules outlined in the .gitignore file. Note that this command only considers files and assets that were included in the latest commit, which means if you make a change to your project, you must add and commit the latest changes again in order for them to be reflected in the zip.

> git archive -o LastName_FirstName_SpinningCube.zip HEAD

While these are some basic commands you will need to use for each project, general knowledge of git could be useful for this class. Check out this great cheat sheet on some common Git commands: https://education.github.com/git-cheat-sheet-education.pdf

Submission Details

Your submission to ELMS should consist of the following 3 files:

Additionally, you should read through the next section and take the associated ELMS quiz.

Previous Section | Go Home | Next Section