← all lessons
git · reference

Glossary

22 terms that recur across the curriculum. Skim before starting; refer back as needed.

branch

A movable pointer to a commit

Branches are incredibly cheap in Git—just 41 bytes (a SHA-1 hash + newline). Creating a branch doesn't copy any files; it just creates a new pointer.

cherry-pick

Copy a single commit to another branch

Applies the changes from one commit to your current branch. Useful for hotfixes, but creates duplicate commits—use sparingly.

clone

Download a complete copy of a repository

Unlike downloading a ZIP, cloning gets the full history and sets up the remote connection. You can push and pull after cloning.

commit

A snapshot of your project at a point in time

Each commit has a unique ID (SHA-1 hash), author, timestamp, message, and pointer to parent commit(s). Commits are immutable—once created, they never change.

detached HEAD

HEAD pointing directly to a commit

Happens when you checkout a specific commit instead of a branch. Any commits you make aren't on a branch and can be lost! Create a branch to save work.

fast-forward

Simple merge with no divergence

When the target branch has no new commits since you branched, Git just moves the pointer forward. No merge commit needed.

fetch

Download changes without merging

Gets new commits from remote but doesn't change your working files. Lets you review changes before merging. 'git pull' = fetch + merge.

fork

Your personal copy of someone else's repository

A GitHub feature. Creates a full copy under your account where you can make changes freely. Used in open-source contribution workflows.

HEAD

Pointer to your current position

Like a 'You Are Here' marker. Usually points to a branch name, which in turn points to a commit. When you commit, HEAD moves forward.

merge

Combine changes from two branches

Git finds the common ancestor, then combines changes from both branches. If the same lines were changed differently, you get a merge conflict.

origin

Default name for the main remote

When you clone a repository, Git automatically names that remote 'origin'. It's just a convention—you can rename it or add other remotes.

pull request

Request to merge your changes into another branch

A GitHub/GitLab feature (not Git itself). Opens a discussion about your changes, allows code review, runs CI checks, and eventually merges when approved.

rebase

Replay commits on top of another branch

Creates cleaner, linear history than merge. But it rewrites commit hashes! Never rebase commits that have been pushed to a shared branch.

reflog

Log of all HEAD movements

Your safety net! Even after reset --hard, reflog remembers where HEAD was. Commits aren't truly lost for 90 days. Use 'git reflog' to find lost work.

remote

Git repository on another computer

Usually GitHub, GitLab, or Bitbucket. The 'origin' remote is the default—it's where you cloned from. You can have multiple remotes.

repository

A folder tracked by Git

Contains your project files plus a hidden .git folder that stores the entire history. Think of it as a project folder with superpowers.

SHA-1

40-character unique identifier for commits

A cryptographic hash that identifies each commit. If any bit of the commit changes, the hash changes completely. This ensures integrity.

signed commit

Commit with cryptographic proof of authorship

Uses GPG or SSH to prove you actually made the commit. GitHub shows 'Verified' badge. Prevents impersonation.

staging area

Preparation zone before commit

Also called 'index'. Files here are queued for the next commit. Think of it as a loading dock—items wait here before being shipped (committed).

stash

Temporarily save uncommitted changes

Like a clipboard for your work-in-progress. Stash changes, switch branches, do something else, then 'git stash pop' to restore your changes.

upstream

The original repository you forked from

When you fork a repo, 'origin' is your fork, 'upstream' is the original. You pull from upstream to stay in sync with the source project.

worktree

Additional working directory for same repo

Lets you have multiple branches checked out simultaneously in different directories. All worktrees share the same .git database. Great for context switching.