GitGit vs GitHub

Git vs GitHub

Beginners are often confused by the two words. They sound related, they are usually mentioned together, and one is named after the other. But they are very different things — one is a tool you install on your computer, the other is a website. Understanding the distinction prevents a lot of conceptual mistakes later.

The short answer
  • Git is the version control software — a command-line program that runs on your machine. It tracks file changes, manages branches, and stores history. It does not need the internet to do most of its job.

  • GitHub is a website (and a company, owned by Microsoft) that hosts Git repositories online. It adds a web UI, pull requests, issue tracking, CI, code review, wikis, and project management on top of plain Git.

  • You can use Git without GitHub. You can read code on GitHub without ever installing Git. But to work on code you usually use both together.

Side-by-side comparison

Git

GitHub

Type

Software (CLI tool)

Web service (SaaS)

Where it runs

Locally on your computer

On GitHub’s servers (the cloud)

Cost

Free, open-source

Free tier + paid plans

Created by

Linus Torvalds (2005)

Tom Preston-Werner et al. (2008)

Needs internet?

Mostly no

Yes — it is a website

What it does

Tracks file changes, manages branches & merges

Hosts Git repos online, adds collaboration features

User interface

Command-line

Browser-based UI + REST/GraphQL API

Alternatives

Mercurial, SVN (mostly historical now)

GitLab, Bitbucket, Codeberg, self-hosted

A concrete example

Imagine you start a new project. Here is what each tool does in a normal day’s work:

Where Git ends and GitHub begins

Bash
# ─── Git work — entirely on your computer, no network needed ───
git init                       # turn a folder into a Git repo
echo "console.log('hi')" > app.js
git add app.js
git commit -m "Initial commit"

# Up to this point, nothing has touched the internet.
# Your code lives only on your computer.

# ─── GitHub work — pushing to the cloud ───
# (You created a repo at github.com/you/my-project first)
git remote add origin git@github.com:you/my-project.git
git push -u origin main

# Now your code lives BOTH on your computer AND on GitHub.
# Other people can clone it, review it, contribute back.
What does GitHub add on top of Git?

Plain Git only does version control. GitHub layers many features on top that are essential for team work:

  • Pull Requests (PRs). A formal way to propose changes from one branch into another, with inline code review, comments, and approvals. Git has merging; GitHub has the workflow around merging.

  • Issues & Discussions. Bug trackers and discussion boards attached to each repo.

  • Code review UI. Side-by-side diffs, suggested edits, threaded comments — all in the browser.

  • GitHub Actions. Built-in CI/CD that runs your tests and deploys your code on every push or PR.

  • Permissions & access control. Public vs private repos, organisations, teams, branch protection.

  • Pages. Free static-site hosting straight from a repo.

  • Packages. Hosting for npm, Docker, Maven, NuGet, RubyGems packages.

  • Copilot. AI pair-programmer integrated into pull requests and the editor.

  • Security tooling. Dependabot, secret scanning, vulnerability alerts.

  • Project boards, wikis, releases, gists, stars, follows… A whole social-and-management layer.

Common misunderstandings
  • “GitHub is just Git in the cloud.” Partly true. The Git part is hosted, but the collaboration features (PRs, issues, Actions) are GitHub-specific products built around Git.

  • “I am committing to GitHub.” No — you commit to your local Git repo. Then you push those commits to GitHub. The two-step is important.

  • “If GitHub goes down I lose my code.” Not if you have a local clone. Every clone has the full history. You can re-push to a different host within minutes.

  • “Git uses GitHub.” Backwards. Git is the older, lower-level thing. GitHub is one of many hosts that use Git.

Other Git hosts (so you know they exist)
  • GitLab — close GitHub competitor. Strong CI/CD, self-hostable, free community edition.

  • Bitbucket — Atlassian-owned, integrates tightly with Jira and Trello.

  • Codeberg / SourceHut / Gitea — community-driven, open-source alternatives.

  • Azure DevOps Repos — Microsoft’s enterprise offering, integrated with Azure pipelines.

  • AWS CodeCommit — Amazon’s managed Git hosting.

  • Self-hosted — you can run your own Git server with Gitea, Gogs, Forgejo, or even bare SSH access on any Linux box.

A mental sentence
“Git is to GitHub what email is to Gmail.” Email is the protocol — you can use it from your phone, your terminal, your home server. Gmail is one popular *service* built around it. Same for Git and GitHub.
Which one do you need to learn first?

Learn Git first, then GitHub. Why?

  • Git is the foundation. GitHub features are intelligible only once you understand commits, branches, and merging.

  • Git is what your daily work happens in. You will spend far more time typing git status than clicking buttons on github.com.

  • GitHub’s UI is largely a friendly face over Git operations. If you understand the Git underneath, the UI becomes obvious.

Tip
Once you have basic Git fluency, opening a GitHub account and pushing your first repo takes about ten minutes. The terminology and concepts you learn in Git transfer 100% to GitHub, GitLab, Bitbucket — anywhere. That investment pays off forever.