How to Set Up a Unity Project that Uses GitHub
Huh? What is all this stuff?
- Git is an version control system for coding and development. It facilitates collaboration and keeps back ups of your projects as you work.
- GitHub is a website that uses git. It is where your project will be stored. It is ubiquitous in software development and is valuable to have in your skillset and on your resume. A free account allows you to make private projects with three collaborators and public accounts with unlimited collaborators.
- GitHub Desktop is software that you install on your local computer that makes using GitHub easier. Without it, you'd need to use the command line.
- LFS stands for Large File Storage. Git wasn't designed to work well with large files. This software allows you to upload and manage large files (for art assets, sounds, etc...). Once it's installed and you copy the gitattributes file into your repository, you can forget about it for the most part.
IMPORTANT! YOU MUST FOLLOW ALL OF THESE STEPS TO SET IT UP CORRECTLY. IF YOU MAKE A MISTAKE, START OVER.
Give yourself 15-20 minutes to do this. After you do it once, it gets a lot easier.
-
Install Git for Windows.
- The install process asks a lot of questions. Just choose all of the default install options (VIM, Git from the command line, OpenSSL, Checkout Windows-style, Use MinTTy...).
- Set up an account on GitHub and log in.
- Download and install GitHub Desktop.
- Download and install LFS.
- Add your Unity Project to GitHub Desktop.
- Find the Unity Project you want to upload on your computer.
- Open GitHub Desktop and click File > New Repository.
- IMPORTANT! Setting these two fields are important.
- Name: This should be the exact name of your Unity project.
- Local Path: This should be the path to the parent folder of your Unity project's folder.
- Select Unity from the Git Ignore dropdown.
- Click Create Repository.
- Download this .gitattributes file.
- Put it in your Unity project folder.
- You will need to show hidden files to see this file. Do that by pressing Command + Shift + Period.
- Commit all your Unity files in GitHub Desktop.
- Give a very brief description of what you've changed (first commit is usually "initial commit."
- Click Commit to master.
- Need help? Find a link to a video about committing files here.
- Publish Your Repository to GitHub.
- Confirm.
- Click View on GitHub to see your project on GitHub.