Git and GitHubgit 2.54 · GitHub · macOS, Linux or Windows
Dashboard
0%
1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
26 small wins to finish your pathNext lesson →

Git and GitHub logoGit and GitHub

Git is a version control system that saves a snapshot of your project every time you ask it to, and GitHub is a website that keeps a copy of those snapshots so other people can work on the same project.

Last updated: 12 Oct, 2026 · git 2.54

A project without version control turns into folders named final, final_v2 and final_v2_fixed, and after a week nobody can say which one runs. Git keeps one folder and remembers every state it has been in. You can read what changed and when, go back to a version that worked, and let two people edit the same project in the same week without overwriting each other.

A map of the four places your work lives when you use Git. The working tree is the folder you edit. git add copies a change into the staging area. git commit turns everything in the staging area into a commit in the local repository. git push sends commits to a remote repository on GitHub, and git pull brings other people's commits back down.

The four places your work lives

Every command in this course moves work between the four boxes above. Three of them sit on your own machine and one of them is on GitHub.

  • The working tree is the folder you edit. Your editor only ever sees this.
  • The staging area is the list of changes that will go into your next commit. You put changes there with git add.
  • The local repository is the .git folder, where every commit you have made is stored. git commit writes to it.
  • The remote repository is the copy on GitHub. git push sends your commits there and git pull brings down what other people pushed.

The project this course builds

Everything is built in one small project: a folder called ask-docs, a helper that answers questions from a company's own documents. It holds a README.md, a prompt.txt, a loader.py that splits documents into chunks, a requirements.txt and a .env with an API key in it. The files are short and you never have to run them. The point is what happens to them: the folder becomes a repository, collects a history you can read, grows a branch for one experiment, hits a real merge conflict and comes out of it merged.

  • Starting out takes you from an empty folder to a commit you can read back.
  • History reads that history with git log and git diff, and writes messages the next person can use.
  • Branches splits the project in two, merges it back and resolves the conflict that comes from both sides editing one file.
  • GitHub, undoing things and a repository a team can read follow in the later parts: the remote, pull requests, taking changes back and the files a reader expects to find.

What you need

  • A terminal: Terminal on macOS, Windows Terminal or Git Bash on Windows, any shell on Linux.
  • Git itself, which the next page installs.
  • A GitHub account, free, for the parts that use the remote.
  • No particular programming language. The example files are a Markdown file, a prompt in plain text and a few lines of Python, and you never have to run them.

Git compared with GitHub

The two names are used together so often that beginners treat them as one thing. They are not.

GitGitHub
What it isA program on your machineA website that hosts repositories
Who made itLinus Torvalds, 2005, open sourceA company, now owned by Microsoft
Needs the internetNoYes
Holds your historyYes, in the .git folderYes, a copy of it
Reviews codeNoYes, through pull requests
You can swap itHard, it is the toolYes, for GitLab, Bitbucket or a server

Where you use version control

  • Your own project. Commit before a risky change so you can get the working version back in one command.
  • A team repository. Everyone works on a branch, and the history says who changed what and why.
  • A job application. A readable commit history on GitHub says more about how you work than a list of frameworks.
Watch out. Git remembers only what you commit. A file you never add is not in the history, a folder you never turn into a repository is not tracked at all, and an editor's undo is gone the moment you close it. Commits are the only memory you can rely on.
Back toAll courses

Every expert started right here.