DEV Community

Cover image for Git vs GitHub

Git vs GitHub

Git and GitHub, a couple of concepts every developer knows quite well, as both are part of the day-to-day work. However, as a newbie, they might sound a bit confusing in the beginning. So let's bring some clarity!

What is Git?

Git is a version control system (VCS), meaning, a way to track all changes you make in your project. Imagine you have replaced some piece of code and the new one is not working for any reason. Thanks to Git, you can go back to your previous version. Cool, right? But Git does not only help keeping track of your project, but it also allows other people to collaborate in the same project at the same time.

Robot versions

In order to use Git, you will need to install Git Bash on your computer. Once you have it, you can work with Git on the terminal. For example, I work with the terminal, which is already integrated in Visual Studio Code and looks like this:

Visual Studio Code Terminal

What is GitHub?

GitHub is a website that works as a cloud storage, similar to Dropbox or Google Drive, where we can host all our projects.

GitHub interface

As you can see, Git doesn't really have an interface, while GitHub can visualize all versions we track with Git. In other words, Git could be considered as a backend, while GitHub as a frontend.

Now you might be wondering: ”if Git works on my local system and GitHub is cloud-based, how do they work together?”. It is necessary to link Git and GitHub in order to save your project versions online and let other people work or contribute to them.

How to do that? Our GitHub account doesn't know our Git user (and vice versa). That is why we need to build a bridge to make them communicate. This can be done with a communication protocol called SSH.

Imagine SSH as your home keys. We will configure them first in Git with the following command:
$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

If you are unsure whether you already have a key or not, you can type the following command on the terminal to check:
$ ls -al ~/.ssh

Once we press enter, an SSH key will be created and saved on your computer. Next thing to do is give that key to GitHub. Go to your GitHub account and paste it under Settings > SSH & GPG keys. More info here.

And there you go! You can start now your project with Git and GitHub.

Git vs GitHub summary

Top comments (0)