
GitHub Desktop is a helpful tool for managing version control and collaborating on Unity projects. In this tutorial, we'll guide you through the process of using GitHub Desktop with Unity. We'll cover all the necessary steps to set up and maintain your project seamlessly. Let's begin!
Installing and setting up GitHub Desktop
To begin using GitHub Desktop, the first step is to create a GitHub account if you don't have one already. Simply visit https://github.com/ and click on the "Sign Up" button. By having a GitHub account, you gain the ability to publish and contribute to repositories hosted on the platform, including your own projects.
Once you have a GitHub account, proceed to https://desktop.github.com/ to download GitHub Desktop for your platform. In this case, since i'm using Windows, I will be downloading the Windows setup. After the download is complete, run the executable file and follow the setup instructions. During the setup process, remember to sign in using your GitHub account credentials.
Making a Unity Project
The next step is to create your Unity project as you normally would. Take note of the file path where you save your project. For example, in my case, the project is located at Desktop/Github Repos/FMP2. This folder should include all the files related to your Unity project, including the Assets and Library folders.
Making a GitHub repository
To create a repository for your Unity project using GitHub Desktop, follow these steps:
- Open GitHub Desktop and click on "File" and then "New Repository."
- In the new repository page, provide the following information:
- "Local path": Navigate to the parent folder of your Unity project.
- "Repository name": Set it to match the name of your project folder.
- "Git Ignore": Select the "Unity" option (This will mean Github will automatically ignore files like system logs and only get the relevant files for your project.).
- Once you have filled in the information, click on "Create Repository."

Once it's finished creating you should be on a page which looks like the image below, from here we will be able to manage our repository.

You should also be able to click the new History button and see your project's initial commit. If you set up the file path and project name correctly here you will be able to see all the files being added of your unity project just like in the image below.

Publishing your repository to GitHub
Now that the repository is set up, you can publish it to GitHub using the following steps:
- Click on the "Publish repository" button located at the top of the GitHub Desktop window.
- If you want to keep your code private and prevent others from downloading your project, make sure to check the "Keep this code private" box.
- Finally, click on "Publish Repository". It may take a moment to create the repository on GitHub.
- Once the repository is created, you'll notice that the "Publish Repository" button is replaced with a "Fetch origin" button. Think of this button as a refresh button that checks if your local copy of the repository is missing any commits compared to what GitHub has.
By following these steps, you can successfully publish your Unity project repository to GitHub using GitHub Desktop.
Once this is done you can also check on https://github.com/ to see if your repository is actually on there, if you go to your profile then your repositories you should see it there.
Using your GitHub repository
Now that all this is done we can begin using our repository. Whenever you make any changes to your project locally they will come up in the changes tab on github desktop. Just like in the image below

Once you have made the desired changes to your Unity project, such as adding a new level or organising folders, you can commit these changes to GitHub to update your repository by following the steps below:
- Give your commit a suitable name that describes the changes you made.
- Optionally, you can add a relevant description to provide more details about the commit.
- Click on the "Commit to main" button to commit your changes.
- After committing, you'll notice that the "Fetch origin" button is replaced with a new "Push Origin" button.
- To push your changes to GitHub, click on the "Push Origin" button. This action will upload your changes to GitHub's servers, allowing them to be accessed from the website or any other device.
- If you need to undo a commit, you can click on the "Undo" button in the bottom left corner.
- Once you are satisfied with your commit, click the "Push Origin" button. It may take a moment, but once the push is complete, your changes will be visible on the GitHub website. Your files are now securely stored on GitHub's servers, accessible from any device at any time.
By following these steps, you can successfully commit and push your changes to GitHub using GitHub Desktop. This ensures your project is safely stored and accessible for collaboration or backup purposes.
What else can I do?
Version control is one of the key benefits of using repositories. Each time you commit changes, they are saved, allowing you to easily revert to previous commits using the history tab. Here's how you can leverage version control:
- In the history tab, right-click on any of your commits and select "Revert changes in commit" to roll back to a previous state.
- The history tab also provides a view of the files you modified, helping you identify and debug any issues that may have occurred between commits.
Moreover, you can access your repository on other machines by setting up GitHub Desktop and cloning the repository. Follow these steps:
- On the other machine, open GitHub Desktop and click on "File" and then "Clone Repository."
- From the menu, select the desired repository you want to clone. This creates a local copy on the new machine.
- You can use the same synchronisation systems mentioned earlier to keep this copy in sync with other instances of the repository.
- If you have pushed changes from one device and want to see them on another, click on "Fetch origin" to retrieve the latest changes. The button will then be replaced with "Pull origin," which will sync the changes to your current device.
By following these steps, you can make use of version control, access your repository on multiple machines, and keep your local copies in sync using GitHub Desktop. This allows for seamless collaboration and easy management of your project across different devices.