Introduction
Overview
Every software project changes constantly. Features are added, bugs are fixed, experiments are tried and abandoned, and several people edit the same files at the same time. Without a system to manage that, you end up with folders called project-final-v2-REALLY-final and the dreaded question: “which version is the one that works?”
Git solves this. It is a version control system: it keeps a complete history of your project, lets you see exactly what changed, when and why, and lets you go back to any earlier version. GitHub builds on Git to let teams share that history, review each other’s work and automate testing and deployment.
By the end of this course you’ll use both the way professional teams do.
Git and GitHub are different things
People often say “Git” and “GitHub” as if they were the same thing. They’re not:
| Git | GitHub | |
|---|---|---|
| What it is | a program on your computer | a website and service |
| Made by | the open-source Git project (started by Linus Torvalds in 2005) | GitHub, Inc. (owned by Microsoft) |
| Works offline | yes, completely | no |
| Main job | record and manage history | share history and collaborate |
| Alternatives | Mercurial, Subversion, Jujutsu | GitLab, Bitbucket, Codeberg |
You can use Git without GitHub — many companies host their repositories on GitLab or their own servers. Everything you learn about Git in this course works with any of them. The GitHub chapters teach the collaboration ideas (pull requests, reviews, CI) that every platform shares, using GitHub’s interface.
What you’ll be able to do
- Track your work: save meaningful snapshots of a project and browse its history.
- Undo safely: throw away bad edits, fix your last commit, revert a broken change, and recover work you thought was lost.
- Branch fearlessly: build features in parallel, merge them, resolve conflicts and keep a clean history.
- Collaborate: push and pull from GitHub, open pull requests, review code and contribute to open-source projects.
- Automate: run tests on every pull request with GitHub Actions and publish tagged releases.
- Work like a professional team: protected branches, good commit messages, hooks, and keeping secrets out of your repository.
How the course works
Every lesson has:
- an explanation with diagrams of what Git is doing behind the scenes — Git is much easier once you can picture it;
- commands you can run — type them, don’t just read them;
- a hands-on exercise with a starter and a solution. Most exercises are short shell scripts that build a small practice repository, so you can run them in an empty folder, break things, delete the folder and try again.
You don’t need to know any particular programming language. You’ll edit small text files (HTML, Markdown, JavaScript) as examples, but the course is about Git, not the code inside the files.
What you need
- A computer running Windows, macOS or Linux.
- A terminal. Git has graphical tools (and your code editor probably has Git built in), but learning the commands first means you’ll understand what those buttons do — and you’ll be able to fix things when the buttons can’t.
- A free GitHub account, from chapter 7 onwards.
About Git versions
This course is written for Git 2.56, the current release in December 2026, and everything works the same on any Git from the last few years (2.30 or newer). Where a command needs a newer version, the lesson says so.
Git 3.0 is planned for spring 2027. For beginners, the visible change is that new repositories will use main instead of master as the default branch name. This course already uses main everywhere, so you won’t need to relearn anything.
Tip: keep a scratch folder (for example
~/git-practice) for the exercises. Each one builds its own small repository, so you can always start fresh.
Check your starting point
Open a terminal (Terminal on macOS, Git Bash or Windows Terminal on Windows, any terminal on Linux) and find out whether Git is already installed and which version you have. Then list Git’s most common commands with the built-in help. If git --version says the command is not found, that’s fine — the lesson *Installing and configuring Git* walks you through it.
# Run these one at a time in your terminal
# 1. Is Git installed? Which version?
# 2. Show the most common Git commands# 1. Is Git installed? Which version?
git --version
# → git version 2.56.1 (any 2.x from the last few years works for this course)
# 2. Show the most common Git commands
git help
# Every command also has its own manual page:
# git help commit (or: git commit --help)Summary
- Git records the history of a project as a series of snapshots called commits, so you can see, compare and undo any change.
- GitHub is a website that hosts Git repositories and adds collaboration tools: pull requests, code review, issues and automation.
- Git runs on your computer and works offline; GitHub is where teams share their work.
- Almost every software team uses Git, and most open-source projects live on GitHub — it is a core professional skill.
- This course goes from your first commit to branching, collaboration, GitHub Actions and recovering from mistakes.