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 | GitHub | |
|---|---|---|
| What it is | Software you install | A website and online service |
| Where it runs | On your computer | On GitHub's servers |
| Needs the internet? | No | Yes |
| Made by | Linus Torvalds, in 2005 | A company founded in 2008, owned by Microsoft since 2018 |
| Cost | Free and open source | Free for most use, with paid plans for teams |
| Main job | Track changes: commit, branch and merge | Store repositories, review changes and work as a team |
| Alternatives | Few: almost everyone uses Git | GitLab, Bitbucket and others |
| In everyday terms | The camera that takes the snapshots | The 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 nowMake a change
History of the rosas-bakery repository (1 commit)
This lesson- 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.
- Push the commit to GitHub
- The host builds the site
- Checks pass
- 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.