Git version control for Unity project and host on GitHub

Git version control is a good practice to maintain your project code, either if you are working alone or collaborating with others. It keeps track of any changes and modifications you make along the way, so you and your teammate will know what might have caused a hiccup during the development course.

There are multiple options to host your git repositories, such as Github, Bitbucket, Gitlab, SourceForge, etc.

In this article, we will focus on the basics of using git to version control our Unity project and host the code on Github.

Step 1-Create an account for Github. (Go to “” and sign up with a working email)

Step 2-Install Git. (Go to “”) and download and install the right one according to your operating system.

There is a GUI client that you can download, which is intuitive to use. But here we will simply go with the command lines.

Step 3-Create a new repository on GitHub for your project by clicking the green New button as shown below.

Once you are at the project creation page, enter your project name and description (optional). Make sure to select “Unity” to the “Add .gitignore” option when initializing the repository.

Now you can get a link to the remote repository. Copy it to the clipboard for later use.

Step 4-Link the above remote repository to our local project.

Go to your local project folder, right-click empty space, and select “Git Bash here”

Type the following command in the prompt:

git init

Then type:

git remote add origin https://the_address_you_just_copied

If any login requests prompt out, simply enter your GitHub account info. Here you have it. The next steps are to actually commit your changes to your projects.

Step 5-First commit

git pull origin master

git status
(check if there are any updates that have not been committed)

git add .
(“.” is a regular expression stands for all, this command adds all the new files; you can also add whichever specific file you want by specifying the file)

git commit -m “a message describing the update”
(“-m” is a flag for message)

git push origin master

That wraps the most basic steps to version control changes in your local projects and host it on Github (pull->check status->add updates->commit updates->push).




Technologist and Unity developer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

All you need to know about LockTrip Referral Links

Andela day 3

Announcing Official Soteria Pro Action: Auto Auditor in Github CI/CD

Swift101: Optional

My limitation

An ON-AIR sign with IoT

Web Development Budget: 12 Ways to Spend Your Money

Getting Comfortable with Logic

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store


Technologist and Unity developer

More from Medium

ESP32 Project — Simple I/O

Getting Java-11 docker images to run on mac m1 (arm64) with adoptium/temurin

Using Version Control With Unity

How to access another super domain url in Cypress while “chromeWebSecurity” is turned on