Git vs GitHub, explained with one picture

By Christophe Paka · Facts checked on 30 October 2026

You open GitHub to learn it, and the first page throws words at you: repository, commit, push, origin, branch. You try a tutorial, then another. Each one mixes two names that sound alike, and you quit again.

That mix up costs you every lesson after it, because each command makes sense only once you know which side it runs on. The fix for git vs github is one split. Think of a camera and a shared photo album: git is the camera on your desk, and GitHub is the album on the internet. The figure below puts the two halves side by side, with the three commands that carry work between them.

Left, your machine running git: the program, your working directory, the .git folder with the full history, and offline commands. Right, github.com: the hosted copy called origin, pull requests, Actions. git push goes right; clone and pull come back.
Figure 1.1 git on your machine, GitHub as a service; git push, git clone and git pull carry work across the internet between them.
Use this diagram on your site

Free to share in your blog post, docs, course or slides, as long as the credit link stays. Paste the code below where the figure should go.

How to read this figure

  1. Read the left panel first. This is git: a free program you install that records every version of a folder of files. It runs offline. It needs no account. The label under the panel says it plainly: it works on a plane.

  2. Find your files and your history. Your working directory holds the files you see and edit. The hidden .git folder holds every commit and branch, the full history. Both sit on your own disk, so the record of your work is yours. The next figure zooms in: the four places a change lives.

  3. Notice what never needs GitHub. The last box lists add, commit, branch, merge and log. All of these are git commands, and none of them talk to GitHub. You can learn them all before you make an account.

  4. Now read the right panel. This is GitHub: a website that keeps a copy of your repository, the remote nicknamed origin. On top it adds the teamwork git has no idea of. A pull request is a proposal to merge your change, with the comments around it. An issue tracks one bug or idea. Actions runs your scripts, such as your tests, on GitHub's machines. The 225M+ in the last box is the crowd of developers GitHub lists.

  5. Follow the arrows in the middle. Only three commands cross the internet. git push sends your commits to GitHub. git clone makes a first copy from GitHub, and git pull brings new commits back. Everything else stays on one side.

Key takeaways

  • Say it once out loud: git records versions on my computer; GitHub keeps a copy and adds the teamwork.
  • Learn add, commit and branch offline first; you need GitHub only when other people or machines must see your work.
  • When a command confuses you, ask which side it runs on; only push, clone and pull cross over.

Worked example: one evening of work, side by side

Take pocket-ledger, the small expense tracker the book builds. Follow one evening of work and mark where each step happens.

  1. You edit README.md on a train with no signal. That is your working directory, left side.
  2. You run git add and git commit. Still the left side: git records the change in the .git folder, offline.
  3. At home you run git push. Now the commit crosses to the right side, to the copy on GitHub.
  4. A colleague opens a pull request comment about your change. That conversation exists only on the right side, because git has no idea what a pull request is.

Result: Three steps happened on your machine and one on GitHub. If GitHub were down that evening, the first three would still work, and your history would still be safe on your disk.

Questions readers ask

What's the difference between git and GitHub?

git is a free program on your computer that records every version of a folder of files. GitHub is a website and service that keeps copies of your git history and adds the teamwork on top: planning, comments and automatic tests. Think of a camera and a shared photo album.

Do I need GitHub to use git?

No. git needs no account and no internet. Every computer holds a full copy of the files and their whole history. You need GitHub when other people, or other machines, must see your work.

Is my code stuck if GitHub is down?

No. git is distributed, so your full history lives on your own disk. You can still edit, commit, branch and merge. What stops is the shared part on the right side of the picture: pushing, pull requests and reviews.

Sources: About GitHub and Git (GitHub Docs); About Git (GitHub Docs).

This figure is from GitHub Made Crystal Clear, chapter 1.

The chapter builds the idea step by step, with recipes you can follow, a Try it to check yourself, and every source.

Get the book

All diagrams