My GameDevHQ Journey Day 1: Installing Git and connecting with Unity 3D

Nnamdi Azikiwe
4 min readDec 23, 2022

--

Objective: Install GIT and connect with Unity 3D

Even though the title says Day 1, I’ve actually been working with GameDevHQ for several weeks now.

The first week was setting up my accounts to prepare for the learning process, followed by going through the learning action plan. Then came Career Prep which covered Resume Building, Cover Letters, and Interview Prep.

Now that we are up to date on where we are in the course, let’s get started setting up GitHub to work with Unity.

We have the choice of using either GitHub or BitBucket as a software repository for version control. For our GameDevHQ course, we are using GitHub even though I’m signed up with both.

Next, we searched for Git on Google and went to the website for the download.

Step 1: Download Git from https://git-scm.com/

Navigating in Git Bash.

Once we download and installed Git, we next want to run Git Bash, which is the command-line interface. After that, we navigate away from the user folder to the Unity projects folder. To do that, we enter the command-line Syntax:

cd (for Change Directory) [project directory]

Next I created a project named “Version Control Example” in Unity and navigated to it.

We’ve navigated to the location of the Version Control Example project created in Unity using Git Bash.

Creating A GitHub Repository

Next, we are going to set up our GitHub repository.

The GitHub website.

To get started, all we need do is click the new button. That takes us to a new page where we can create the new repository. I gave it a name and a description, as well as made it public. I also added a .gitignore file so that Unity will not include temp files and library files in the commit.

Creating a new repository on GitHub

Linking GitHub to the Local Unity Project

Now that we created the repository, we need to link it to our project. The way to do that is to add it to the local project. We do that by initializing Git in our project. First thing we do is copy the link to the repository, then go to Git and navigate to our Unity project.

We can navigate like we did above. Another way to do that is go to the Unity project in Windows Explorer and right click. Then select Git Bash Here and Git opens in the location of our Unity project.

Opening Git Bash at the location of our Unity project in Windows Explorer

Next in Git, all we have to do is type the keyword “git” followed by the command “init.” That tells Git to initialize the local Unity project for version control.

git init initializes the local Unity project

Next we use Git to link our repository on GitHub with the Unity folder on our desktop. The way we do that is go to the Git Bash command line window and enter the keyword “git” with the command “remote add origin.” That tells Git we are using a remote server named origin. Then we add the URL linking to the server on GitHub. We verify that it worked using “git remote -v.” The response in Git shows we have permission to fetch and push to origin.

The command and keywords git remote -v show we are connected to the server “origin.”

Next I’m going to demonstrate how to do a commit and then how to add a branch to the repository.

--

--

Nnamdi Azikiwe

Join me on a 90+ day journey in Game Development with Unity 3D using C#.