GitHub

GitHub for Unity Package

Warning

From the reviews on the Asset Store, it is not reccommended that you use GitHub for Unity as it is prone to breaking and has a lack of development with later versions of Unity. Use to GitHub for Desktop instead.

Installation

You can install GitHub for unity in the editor following these steps:

  1. Go to the Unity Asset Store and search for GitHub.

  2. Click on GitHub for Unity and on its store page click the “Add to My Assets” button.

  3. In the unity editor. Go to Window > Package Manager.

  4. In the Packages dropdown select My Assets. Then search for GitHub.

  5. Select the GitHub for Unity package and click Import

GitHub Desktop

Installation

Install GitHub Desktop from https://desktop.github.com/ and follow the installation instructions

Add An Existing Project

Lets say we have an existing project located at C:\UnityProjects\ExampleProject. To create a git repository from this project follow these steps:

  1. Open and sign into GitHub Destkop

  2. Go to File > New repository…

  3. Given that our project is located at C:\UnityProjects\ExampleProject we set ExampleProject for the Name and C:\UnityProjects for the Local path.

  4. Under the Git ignore option select Unity

  5. If the existing project uses Git LFS, Github Desktop may prompt you to initialize Git LFS. If it does click on Initialize Git LFS

  6. After initializing the repository, you can publish it by clicking on the Publish repository button at the top left of the GitHub Destkop window.

Clone from an online repository

  1. Go to File > Options and sign into your GitHub account

  2. Select Current Repository dropdown > Add dropdown > Clone repository

  3. Select an existing repository from github.

  4. Choose a location on your computer to clone the repository.

    Note

    When choosing where to clone your repository you do not have to create a new directory with your project name it will automatically be created at the location you specify

Undo Some / All Uncommitted Changes

If you want to undo some or all of your changes

  1. Go to your repository on GitHub Desktop

  2. Click the Changes section

  3. Select the changes you wish to discard, right click them, and select the discard option.