Introduction to Git and GitHub
This domain covers the foundational concepts of Git as a version control system and GitHub as a collaboration platform. It accounts for 22% of the GitHub Foundations exam, making it the single most-weighted domain. Questions test precise definitions, feature-to-plan mappings, naming of specific GitHub features, and the ability to distinguish between closely related concepts (e.g., rebase vs. merge, organization vs. enterprise, Free vs. Team plan).
Git vs GitHub: Version Control System vs Collaboration Platform
Git is a free, open-source distributed version control system (DVCS) created by Linus Torvalds in 2005. It runs locally on your machine and requires no internet connection or GitHub account.
GitHub is a cloud-based collaboration platform built on top of Git. It adds hosting, access control, project management, CI/CD, and AI features that Git itself does not provide.
| Attribute | Git | GitHub |
|---|---|---|
| Type | Version control system | Collaboration platform |
| Created by | Linus Torvalds (2005) | Tom Preston-Werner et al. (2008) |
| Runs where | Locally on any machine | Cloud (github.com) + GitHub Enterprise Server |
| Internet required | No | Yes (for cloud features) |
| Core function | Track file changes over time | Host repos + enable team collaboration |
| Owned by | Open-source / Software Freedom Conservancy | Microsoft (acquired 2018) |
| Can exist without the other | Yes — Git works without GitHub | No — GitHub requires Git |
Common traps
- The exam may ask what Git provides that GitHub does not (offline version control, branching, local commits). Git does not provide Issues, Pull Requests, or Actions — those are GitHub features.
- GitHub is not the only Git hosting platform (GitLab, Bitbucket also exist), but the exam focuses exclusively on GitHub.
- "GitHub is a version control system" is a false statement; it is a platform that uses Git.
Git Core Concepts
Bold terms below appear directly in exam questions.
| Concept | Definition | Key detail |
|---|---|---|
| Repository (repo) | A directory tracked by Git, containing all files and their history | Can be local or remote |
| Commit | A snapshot of tracked changes with a unique SHA-1 hash | Immutable once created; requires a message |
| Branch | A lightweight movable pointer to a specific commit | Default branch is named main (was formerly master) |
| Merge | Combines the history of two branches, creating a merge commit | Preserves full history |
| Rebase | Moves or re-applies commits from one branch onto another base | Rewrites commit history; creates linear history |
| Tag | A named, static pointer to a specific commit | Used to mark release points (e.g., v1.0.0) |
| Clone | Creates a full local copy of a remote repository | Includes all history |
| Fork | A GitHub-side copy of a repo under a different account | Enables contribution without direct write access |
| Pull Request (PR) | A GitHub feature to propose merging one branch into another | Not a Git concept — GitHub only |
| Staging area (index) | Intermediate area where changes are prepared before committing | git add moves changes here |
| HEAD | A pointer to the currently checked-out commit or branch | Detached HEAD = pointing directly to a commit |
Merge vs. Rebase — decision flow:
How Git handles branching, merging, and rebasing
Common traps
- Rebase rewrites history — the exam tests whether you know it is unsafe on shared/public branches.
- A fork is a GitHub concept; a clone is a Git concept. Forking does not exist in Git itself.
- Tags are not branches — tags are static and do not move when new commits are added.
- The default branch name is main, not
master, on newly created GitHub repositories (changed in 2020). - A merge commit has two parent commits; a regular commit has one.
Worked scenario
A developer wants to contribute to an open-source project where they do not have write access.
Reasoning: The developer must fork the repository to their own account (GitHub feature), clone that fork locally (Git), make changes, push to the fork, then open a Pull Request to the original repository. They cannot push directly to the upstream repo.
Sign in free to read the full guide
11 more sections (about 2,825 words) continue below. The first domain's study guide is free for every GH-900 learner with a free account.