Skip to content

Domain 1: Introduction to Git and GitHub (22%) โ€‹

โ† Overview ยท Domain 2 โ†’


Git vs GitHub โ€‹

Git and GitHub are often confused โ€” understanding the distinction is foundational to this exam.

Git is a free, open-source distributed version control system that runs locally on your machine. It tracks changes to files, enables branching, and supports collaboration through merging.

GitHub is a cloud-based hosting platform built on top of Git. It adds collaboration features: pull requests, Issues, Actions, Codespaces, and more.

AspectGitGitHub
TypeCLI tool / version controlCloud platform
RunsLocally on your machineWeb + cloud
Created byLinus Torvalds (2005)GitHub, Inc. (2008)
Core functionTrack file changesHost repos + collaborate
Can work without the other?Yes (local only)No (needs Git underneath)

Exam Tip

Questions about "where does this happen" โ€” if it's tracking changes, commits, or branching, answer Git. If it involves pull requests, Issues, or web interface, answer GitHub.


Core Git Concepts โ€‹

Commits โ€‹

A commit is a snapshot of your files at a point in time. Each commit has:

  • A unique SHA hash (e.g., a3f5b2c)
  • An author and timestamp
  • A commit message describing the change
  • A pointer to the parent commit(s)
bash
git commit -m "Add user authentication module"

Branches โ€‹

A branch is a lightweight, movable pointer to a commit. The default branch is typically named main (formerly master).

  • Create a branch: git branch feature/login
  • Switch to it: git checkout feature/login or git switch feature/login
  • Create + switch: git checkout -b feature/login

Merging โ€‹

Merging integrates changes from one branch into another. Types:

  • Fast-forward merge โ€” linear history, no merge commit needed
  • Three-way merge โ€” creates a merge commit when histories have diverged

The Three States of Git โ€‹

StateLocationDescription
Working directoryLocal filesWhere you edit files
Staging area (index).git/indexFiles marked for the next commit
Repository.git/Committed history
Working Dir โ†’ git add โ†’ Staging โ†’ git commit โ†’ Repository

Key Workflow

git add moves changes to staging. git commit moves staged changes to the repository. git push sends commits to GitHub.

Essential Git Commands โ€‹

CommandWhat it does
git initInitialize a new local repo
git clone <url>Copy a remote repo locally
git statusShow working tree status
git add <file>Stage changes
git commit -m "msg"Commit staged changes
git pushUpload commits to remote
git pullFetch + merge remote changes
git logView commit history
git diffShow unstaged changes

GitHub Interface Options โ€‹

GitHub can be accessed through multiple interfaces โ€” the exam tests which to use when.

InterfaceBest forKey features
Web UI (github.com)Browsing, reviewing PRs, IssuesFully featured, no install
GitHub CLI (gh)Scripting, terminal workflowsCreate PRs, Issues from terminal
GitHub DesktopVisual beginnersGUI drag-and-drop
github.dev (press . in any repo)Quick edits in browserVS Code in browser, no compute
CodespacesFull dev environmentCloud VM with VS Code

Common Trap

github.dev and Codespaces look similar but differ fundamentally. github.dev is a browser editor with no terminal/compute. Codespaces is a full cloud VM you can run code in.


Repository Visibility Types โ€‹

VisibilityWho can see itUse case
PublicEveryone (internet)Open source projects
PrivateOnly invited collaboratorsPersonal or commercial work
InternalAll members of the organizationInnerSource (enterprise only)

Internal Repos

Internal visibility is only available on GitHub Enterprise Cloud organizations. It enables InnerSource โ€” sharing code across teams within a company without making it fully public.


GitHub Flavored Markdown (GFM) โ€‹

GitHub renders Markdown across READMEs, Issues, PRs, Discussions, and Wikis. Key GFM extensions:

SyntaxRenders as
**bold**bold
*italic*italic
# HeadingH1 heading
`code`inline code
- [ ] / - [x]task list (unchecked/checked)
@usernameuser mention (notifies them)
#123links to Issue/PR #123
> textblockquote

Exam Tip

Task lists (- [ ]) in Issues and PRs are tracked as completion progress. @mentions trigger notifications. # references auto-link Issues and PRs.


Domain 1: Git & GitHub Fundamentals

1 / 7
โ“

What is the difference between Git and GitHub?

(Click to reveal)
๐Ÿ’ก
Git is a local version control tool. GitHub is a cloud platform built on Git that adds collaboration features like pull requests, Issues, and Actions.

โ† Overview ยท Domain 2 โ†’

Happy Studying! ๐Ÿš€ โ€ข Privacy-friendly analytics โ€” no cookies, no personal data
Privacy Policy โ€ข AI Disclaimer โ€ข Report an issue