Skip to main content
Notifications
FREEBeginnerModule 1 Β· Lesson 1

What Git and GitHub are

Next lesson 0 of 5 lessons done

What you will learn

How Git tracks changes, what GitHub adds on top, and the words you will meet in every tutorial.

Key commands

git --version

Git and GitHub are two different things

Git is a version control system. It runs on your own computer and records every change you make to a project, so you can look back at an earlier version, see what changed and when, and undo a mistake. Linus Torvalds created it in 2005 to manage the development of the Linux kernel, which needed a tool that could handle thousands of contributors.

GitHub is a website built around Git. It stores a copy of your project in the cloud and adds the parts that make teamwork possible: sharing code, reviewing each other's changes, tracking issues and showing your work to the world. Other platforms offer similar features, such as GitLab, Bitbucket and Azure Repos, but GitHub is the most widely used home for open source projects and developer portfolios.

Why version control matters

Imagine you delete an important function by accident. Without version control that code may be gone for good. With Git, every saved change is part of a history that records who made it and why, so you can step back to a version that worked.

Git is also distributed. Every developer holds a full copy of the project history on their own machine, which makes it fast and resilient, and it means you can keep working without an internet connection.

Picture a team building an online shop. One developer builds the product pages, another builds checkout and a third builds sign in. Each works on their own copy. When a feature is ready, they send their changes to GitHub, where teammates can review them and combine everything into one working project.

Words you will meet again and again

  • Repository (repo): the folder where Git stores your project and its full history.
  • Commit: a saved snapshot of your changes at one moment in time. Each one gets a unique hash, a long code that identifies it.
  • Branch: an independent line of development. You can try an idea on a branch without touching the main version.
  • Working tree: the current state of the files in your project folder.
  • Remote: a copy of the repository that lives somewhere else, usually on GitHub.
  • Fork and clone: a fork is your own copy of someone else's repository on GitHub, and a clone downloads a repository to your computer.

Public and private repositories

A public repository can be seen by anyone, which is how open source projects work. A private repository is visible only to people you invite. Many companies keep their code private and give access to the team through permissions.

What to do next

Check that Git is installed by opening a terminal and running the command below. If it prints a version number, you are ready. If not, the next lesson walks through installing it.

Then create a free GitHub account if you do not have one yet. Once you have an account, the lesson after this one shows you how to create your first repository and save your first commit.

Resources