LearnThatStack Ace your next interview
Git & Version Control · question
Question 2 of 54

What is the difference between Git and GitHub, and why does it matter?

beginner
← All Git & Version Control questions
Re-explain

Git is the version control program on your machine, and GitHub is a service that hosts Git repositories online and adds tools around them.

Git GitHub
What it is a command-line tool a hosting service built on Git
Main features git commit, git branch, git merge Pull requests, issues, code review
Where history lives .git on your disk a hosted copy of the repository
Team extras none built in access control, Actions for CI

It matters because Git works without GitHub. Your full history lives in .git on your disk, so you can work offline even when GitHub is down.

Switching hosts means pointing your remote, the address Git pushes to and fetches from, at a new URL. Git itself does not change, and hosts like GitLab or Bitbucket serve the same repositories.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

The diagram below the answer is the concept . Jump to it ↓

Tailored explanation · switch back to · ·
What should the new diagram focus on?
Guided practice for Git & Version Control One question at a time. Answer out loud, get graded, see what you missed.
How well did you know this?
AI:

Saved in this browser - sign in to keep your review list.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Interview lens How interviewers actually use this question

Likely follow-ups

  • If GitHub goes down for a day, what can your team still do, and what stops? Commit, branch, merge, log and diff all work locally. Push, pull, PR review and Actions CI wait, unless the team pushes to another remote.
  • Why can Git commit offline when a centralized tool like Subversion cannot? Every clone holds the full history, so commits and log are local operations. A centralized system keeps history on a server you must reach.
  • How does a fork on GitHub differ from a clone, and how do you keep a fork up to date? A fork is a copy on the host under your account, a clone is a copy on your disk. Add the original as a remote, often named upstream, and fetch from it.
  • How would you move a repo from GitHub to GitLab, and what would not come with it? Point the remote at the new URL and push all branches and tags. Issues and PRs need a separate import, and Actions CI has to be redone.
  • Is a pull request part of Git itself? Where is it stored? The host stores PRs and their review comments, not .git. Underneath, a PR is a request to merge one branch into another.

What you can say

  1. Git is the version control program that runs on your machine, and GitHub is an online service that hosts Git repositories and adds tools around them.
  2. Git gives you the core commands, like commit, branch and merge, and it keeps your full history in the .git folder on your disk.
  3. GitHub keeps a hosted copy of that repository and adds team features on top, such as pull requests, issues, code review, access control and Actions for CI.
  4. The split matters because Git works without GitHub, so I can commit and read history offline even when GitHub is down.
  5. A remote is just the URL Git pushes to and fetches from, so moving to GitLab or Bitbucket means changing that URL, and Git itself stays the same.
  6. GitHub's own features don't move with the repo, though, so pull requests, issues and CI setup stay behind unless you migrate them.

Weak answers to avoid

  • Treats Git and GitHub as the same thing Saying 'I pushed to Git' or calling GitHub a version control system shows a shaky model. Name Git as the tool and GitHub as one host for it.
  • Says the history lives on GitHub Every clone has the full history in .git. Missing that hides why offline work is possible and why changing hosts only means changing a URL.
  • Lists features, never says why it matters The question asks why. Tie the split to real cases, like working while GitHub is down or moving hosts by changing the remote URL.
  • Thinks pull requests are a Git feature PRs, issues and Actions belong to the host. Git has branches and merge. Mixing them up suggests you have only used Git through a web UI.
Interview lens

Likely follow-ups, what you can say, and the weak answers to avoid.

Sign in free to open it Free account - the lens opens as soon as you're back.

Want a quick review of the fundamentals? See the Git & Version Control cheatsheet.

← Back to all Git & Version Control questions
Pro · $10/mo

47 of 54 Git & Version Control answers are in Pro.

Full answers, code samples, and AI explanations that go simpler or deeper. Cancel anytime.

  • Full answers + code
  • AI explanations, simpler or deeper
  • 1,000 AI credits / month
  • Cancel anytime