2.2 Git vs GitHub
Key Takeaways
- Git is the open-source distributed version control system: it tracks commits, branches, and history in a local repository, including the hidden .git directory.
- GitHub is a collaboration platform that hosts Git repositories and adds Issues, pull requests, Actions, organizations, access control, and related products.
- You can use Git without GitHub (another host, a self-hosted remote, or local-only); GitHub still stores Git objects even when you work only in the web UI.
- git commit, git branch, git merge, git log, and git blame are Git operations; opening a pull request, filing an Issue, and running a workflow are GitHub operations.
- Treating "Git" and "GitHub" as synonyms is a GH-900 trap: GitHub is based on Git, but GitHub is not Git.
Git and GitHub are related and they are not the same product. GitHub Docs states the split plainly: Git is a version control system that tracks changes to files; GitHub builds on Git by hosting your Git projects (repositories) in the cloud and adding planning and collaboration tools. GH-900 Domain 1 lists "Explain the difference between Git and GitHub" as its own bullet because treating the two names as synonyms is the most common beginner error on this exam.
Git: the distributed VCS
Git is open-source software. It runs on your computer (and on any server you choose). When GitHub Docs says "At the heart of GitHub is an open-source version control system (VCS) called Git," it means Git is responsible for everything GitHub-related that happens locally: initializing a repository, recording commits, creating branches, merging, inspecting log, and talking to remotes with fetch / pull / push.
A Git repository is the collection of files plus the object database and refs stored in the hidden .git directory. You can create one with git init in an existing folder, or copy an existing project with git clone. After that, Git works even if GitHub.com is unreachable: you can still edit files, git add, git commit, and inspect git log. The network is required only when you want to publish or retrieve commits from a remote.
Common Git operations GH-900 expects you to recognize:
git init— start tracking an existing directory (creates.git)git clone— copy a remote project, including files, history, and branchesgit add— stage changes for the next snapshotgit commit— record a snapshot in historygit status/git log/git diff— inspect working tree, history, and changesgit branch/git switchorgit checkout— create and move among lines of developmentgit merge— combine two lines of developmentgit push/git pull— publish local commits to a remote, or update the local branch from a remote
Those commands are Git. They work against GitLab, Bitbucket, a USB drive, a bare repo on a company server, or GitHub. The remote URL does not change what Git is.
GitHub: hosting plus collaboration
GitHub is a platform for building software. It hosts Git repositories and then adds the rest of the software development life cycle: plan (Issues, Projects, milestones), create (repos, branches, Codespaces, Copilot), review (pull requests), test and deploy (Actions), and operate (Dependabot, security alerts, packages). GitHub Docs' "What is GitHub?" article maps those stages explicitly. None of Issues, pull requests, Actions, organizations, or access-control roles exist in Git itself.
GitHub is available as GitHub.com (the public SaaS), GitHub Enterprise Cloud, and GitHub Enterprise Server. All three host Git repositories. They differ in where the service runs and how identity is managed — not in the fact that the underlying objects are still Git commits.
You can complete GitHub flow from the web UI, GitHub CLI, or GitHub Desktop without typing git on a terminal. That convenience does not turn GitHub into Git. The web UI still creates Git commits, Git branches, and Git objects. A pull request is a GitHub conversation about a Git branch comparison.
Where people mix the names
| Task | Who does it? | Exam wording |
|---|---|---|
| Record a snapshot on your laptop with no network | Git | commit, local repository |
| Store that snapshot on github.com | Git talks to a GitHub remote | git push to origin |
| Ask teammates to review the snapshot | GitHub | pull request |
| Track a bug or a feature idea | GitHub | Issue |
| Run tests on every push | GitHub | Actions workflow |
| Put many repos under one billing and permission boundary | GitHub | organization or enterprise |
| Attribute the last change to a line | Git (GitHub shows Blame) | git blame |
GH-900 trap: "GitHub is Git in the cloud" is incomplete. GitHub hosts Git repositories and adds collaboration products. An answer that says GitHub is Git, or that Git includes pull requests, is wrong.
You can use Git without GitHub
Developers used Git for years before GitHub existed, and they still do. A team can:
- Keep a local-only Git repo for personal history
- Push to a different host (GitLab, Bitbucket, Azure Repos, Codeberg)
- Run a bare repo on an internal server and
git pushover SSH
None of those setups is "using GitHub." Conversely, a writer who never installs Git can still open github.com, edit a file in the browser, and commit. GitHub creates a Git commit on their behalf. They used GitHub; Git still recorded the snapshot.
You cannot replace Git with GitHub features
If GitHub.com is down, your clone still has history. If you only downloaded a ZIP of the files, you have no Git history to work offline. If you need a pull request, you need GitHub (or another host that invented an equivalent). If you need a commit, you need Git — locally or through GitHub's Git-backed UI.
Two collaboration models on GitHub, still Git underneath
GitHub Docs describes two primary ways people collaborate:
- Shared repository — teammates are granted read, write, or admin on one repo. Typical for a company team. Combined with protected branches, this is how most inner-source projects work.
- Fork and pull — anyone who can view the project copies it to their account (a fork), commits there, and opens a pull request back to the original. Typical for public open source, where granting write access to strangers is not practical.
Both models still use Git commits and Git branches. The fork is a Git repository under another namespace. The pull request is GitHub's review UI on top of a Git comparison.
Commands versus platform products
When a GH-900 item shows a command (git commit -m "fix timeout"), the subject is Git. When an item shows Issues, a pull request review, Actions YAML under .github/workflows, an organization, or Copilot, the subject is GitHub. Mix-and-match distractors are common:
- "Create a pull request with
git pull-request" — Git has no first-class pull request.git request-pullexists for email-based workflows; GitHub pull requests are a GitHub feature. - "Git organizations control repository permissions" — organizations are GitHub accounts, not Git objects.
- "GitHub stores diffs instead of snapshots" — GitHub stores Git objects. Git's data model is snapshots.
Scenario: Maya on a plane
Maya clones octo/docs before a flight. Offline she creates a branch, edits three Markdown files, stages, and commits twice. That entire sequence is Git. After landing she git pushes to origin and opens a pull request so a maintainer can review. The push talks to GitHub's Git server; the pull request is GitHub collaboration. If the exam asks "which tool recorded the snapshots during the flight," the answer is Git, not GitHub.
Why the distinction matters later on GH-900
Later domains assume this split. Repository files (README, LICENSE) live in Git. Branch protection, org roles, and EMU policy live on GitHub. Actions YAML is a Git file that GitHub's runners execute. Copilot suggests code that still becomes a Git commit. If you collapse Git and GitHub into one word, those later items become unanswerable.
Which statement correctly distinguishes Git from GitHub?
A candidate can commit, create a branch, and inspect history on a laptop with no network. After reconnecting, they open a pull request so a teammate can review. Which split is correct?
A team wants version control but is not allowed to use github.com. Which statement is accurate?