Foundations: Your First Repository

So, at this point, we’ve installed Git and Unity, we’ve set up a GitHub account and we created our very first Unity project. Now, we’ll link Git, GitHub and Unity together so we can tracking our changes.

Create a local repository

First, open Git Bash and navigate to your project directory. Check out my previous article for a refresher.

Once you are in your project directory, you will need to create, or initialize, your local Git repository. To do this, enter git init into Git Bash. From this point on, Git will track any changes to your project files within this directory.

git init command in Git Bash terminal

Link a remote repository

To be able to communicate changes between Git and GitHub, we’ll need to link our remote repository to our local repository. Log into GitHub and either create or open a new repository. Check out my article on Setting up a remote repository for step-by-step instructions on getting started with GitHub.

Once you’re in your GitHub repository, select Code and copy the URL provided.

Where to find the URL for your GitHub repository

In Git Bash, while in your local Git repository, enter git remote add followed by a reference name for the remote repository (traditionally origin) and then paste the URL copied from GitHub above. The keyboard shortcut for pasting (Ctrl + V) does not work in Git Bash, so be sure to right-click and select Paste from the menu.

git remote add origin command in Git Bash

To confirm the link was created successfully, enter git remote -v into Git Bash.

git remote -v command in Git Bash

Now that our local and remote repositories are initialized and linked, we’ll dive into the new way to save changes through Git in the next article.

--

--

--

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

Recommended from Medium

The First Mile

Apache Kafka Tutorial — Kafka For Beginners

Introduction to CS Bootcamp Recap

Linux Commands You’ll Actually Need for Your Data-Engineering Journey.

The RGBA Histogram for a UIImage in Swift 5

Python for Lifetime — LIST

Circuit Breaker Pattern — What and Why?

Implementing RabbitMQ and Kafka: common use cases

PubSub with rabbitMQ

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
Erin Brown

Erin Brown

More from Medium

Understanding version control and mastering git — Branches and more.

Owning features, and how to deliver in an organized way

Making Sense of SQL: Part 3

Data structure and Algorithm: Big O

Big-O complexity chart