Skip to content
AITermsLab
–points–day streak

Git vs GitHub: what's the difference?

Git is free software on your computer that tracks every change to a project. GitHub is a website that stores Git repositories online, so you can back them up, share them and work on them with others.

Last updated

What each one means

Git
Git is free software that tracks every saved change to a project's files, so you can go back to any version and several people can work together safely.
GitHub
GitHub is a website, owned by Microsoft, that stores Git repositories online so people can back up, share and work on code together.

Side by side

Git compared with GitHub
GitGitHub
What it isSoftware you installA website and online service
Where it runsOn your computerOn GitHub's servers
Needs the internet?NoYes
Made byLinus Torvalds, in 2005A company founded in 2008, owned by Microsoft since 2018
CostFree and open sourceFree for most use, with paid plans for teams
Main jobTrack changes: commit, branch and mergeStore repositories, review changes and work as a team
AlternativesFew: almost everyone uses GitGitLab, Bitbucket and others
In everyday termsThe camera that takes the snapshotsThe online album where you share them

An example: two people, one bakery site

Rosa and Sam each have the bakery site's repository on their laptops, and Git tracks their changes. They both push their commits to the same repository on GitHub. Sam reviews Rosa's change there, it's merged into main, and the host deploys it.

See Git: commit and roll back

The demo puts a made-up bakery page under Git. Add opening hours or change the button, commit each change with a message, then roll back to any earlier version. The roll-back is a new commit, so no version is ever lost.

Your working copy (branch: main)

Rosa's Bakery

Order now

Make a change

Everything is committed.

History of the rosas-bakery repository (1 commit)

This lesson
  1. a1f3c9 First version

Branches

A branch is a safe copy to try an idea on.

Git keeps every saved version. Make changes, commit them, then roll back to any earlier version: the roll-back is a new commit, so nothing is lost.

See what happens after a push: deploy

The demo deploys a new section to a made-up bakery site: push, build, checks, live. Switch on a typo and the build fails, so the live site keeps the old version and visitors never see the broken change.

Deploy your latest change

The change: a new “Weekend specials” section on the home page.

  1. Push the commit to GitHub
  2. The host builds the site
  3. Checks pass
  4. The new version is live

rosas-bakery.example (what visitors see)

Rosa's Bakery

Fresh bread every morning

Live version: 1

Deploying puts your latest code on the live site. Hosts build and check it first, so a broken change stops before visitors see it. Try it with the typo on.

Common questions

Can I use Git without GitHub?

Yes. Git works entirely on your computer. GitHub only matters when you want an online copy, or want to work with other people.

Can I use GitHub without knowing Git commands?

Mostly, yes. GitHub's website and desktop app, and many AI coding tools, run the Git commands for you.

Is GitHub free?

For most people, yes, including private repositories. Paid plans add features for teams and companies.