Setting Up Git For Unity

Chris Daley(Desonn)
3 min readMar 23, 2021

Git allows you to have version control of your unity projects as well as backing it up.

Lets get git

Download git from https://git-scm.com/

Repository Setup Time!

Jump over to Github and create an account or login to your account if you already have one. After that click the new button in the top left corner like the the photo below.

You will be taken to this page after you click it

Give your repo a name. Also check the add .gitignore and choose the unity template so we don’t download any extra files to our unity project. Photo below for example

After that just click create repository

Now go to your unity project folder and right click and choose git bash here

you now have your unity folder on gitbash to start the process of linking you need to initiate git. enter “git init

this will initialize the repository the next we will be adding your unity files within your project to the repository.

Enter the command “git remote add origin (your github link)”

The remote command shows that we working within our repository.

The next command to run is ‘git pull origin main’ which will pull the repository info into your project. Then type ‘git add .’ which will stage everything in your Unity project to be committed.

Next type , ‘git commit -m”Message”’ where Message is a place for your notes on the commit. Since this is the first time , something like 1st commit will work.

Next type ‘git push origin main’ will put your Unity project into your git repo.

Your project will now be linked to your git repo and you are all setup!

--

--