How to Integrate Unity3D with GitHub
This tutorial explains the steps to integrate a Unity3D project with GitHub.
Game development often involve teams of people working on different versions of a single project. An entire software can be divided into separate parts and then later merged into one. These versions/parts are called branches. GitHub is an invaluable tool for managing branches and versions of a Unity3D project.
As demonstrated below, you can control different versions of a single coding project using Git. You can branch out from your master version to develop different portions and merge those branches back into the master version once they are completed (refer to https://git-scm.com/about for more information about git).
Below are the list of steps to integrate GitHub and Unity3D.
- We will start by creating a Unity3D project named, “Adventure Game Project.”
2. Go to your GitHub account. Create a new Repository and name it “Adventure Game Project.” Leave Public selected. Select the option for .gitignore. Search for and select Unity.
3. In GitHub, copy the HTTPS link to the Repository just created.
4. With Git installed already, navigate the directory in which your project is saved. Right-click and select “Git Bash Here”. The window that will appear is where version management occurs.
5. Navigate to the project folder by typing cd Adventure Game Project.
6. Initialize Git with your Unity project. Type git init.
7. With the link copied from Step #3, type git remote add origin and paste the GitHub repository link afterward.
8. You can verify that your project is linked to your repository by typing git remote -v. It should populate the GitHub link followed by fetch and push.
Summary
In steps 1–2, we made two things:
- Unity Project
- GitHub Repository
In steps 3–8, we linked these two together by doing the following:
- Navigate to the directory. (Steps 4–5)
- Initialize a git repository within that directory. (Step 6)
- Link our current repository to our remote repository on GitHub using the link copied in Step 3. (Step 7)
- Verify we are linked to the GitHub repository. (Step 8)
At this point, we will now be able to create and save different versions of our program. They will all be stored in your GitHub account, where you will be able to see the version history of your project.