Screenshot 2023-06-22 at 11.59.33 AM.png

Open Chabot Game Lab

Created 9/5/2023 - J.G.

How to use Github Desktop for version control with Unity

What: Github Desktop, Unity

Why: When you “save” a file in Unity, it actually saves to your computer. With Github Desktop, you are able to control the versions you save, and can revert to past versions of your game easily.

Resource Video:

Screenshot 2023-09-05 at 2.27.14 PM.png

https://www.youtube.com/watch?v=qpXxcvS-g3g&ab_channel=Brackeys

Instructions:

Create a Github account and make a new repository

  1. Create a new repository. A repository is like a Google Drive, where you can share files with others, and have it publicly available.

Screenshot 2023-09-05 at 2.11.17 PM.png

  1. Make sure you add a .gitignore file with the Unity template. This allows Github to ignore files that aren’t necessary for sharing your Unity game (thousands of files that you don’t need shared).

Screenshot 2023-09-05 at 2.11.39 PM.png

  1. Click Create repository. Your repository is now created.

Screenshot 2023-09-05 at 2.16.07 PM.png

  1. Edit the README.md file and add a description to your readme. This shows up on the front page of your repository. Edit the readme file and add description of your change.

Screenshot 2023-09-05 at 2.20.03 PM.png

Get Github Desktop

  1. Download Github Desktop

  2. Click Clone Repository

Screenshot 2023-09-05 at 2.28.44 PM.png

  1. Choose your project from the dropdown.

    1. The local path is where your Unity game is going to be saved. Create a folder where all your Unity games will go. Ex. I put mine in a new folder called GitHub in my Documents Folder, i.e. Documents/GitHub/untitled-cat-vr-game Another Ex. You can create a new folder on your Desktop called Projects, i.e. Desktop/Projects/untitled-cat-vr-game

    P.S. If the project is not in your Github folders, you can get the direct link from the Github.com website with your repository (see last picture).

Screenshot 2023-09-05 at 2.30.31 PM.png

Screenshot 2023-09-05 at 2.29.46 PM.png

  1. Navigate to the folder on your computer and you’ll see that it has the .gitignore and README.md files now.

    Screenshot 2023-09-05 at 2.36.13 PM.png

Create your Unity Project

  1. Open Unity Hub and create a new project. Choose the URP (universal render pipeline) template, which is compatible with most things.
    1. Name your game project (Untitled Cat VR Game)
    2. Choose the location! Choose the folder you created. (Documents/GitHub/untitled-cat-vr-game)