Chapter 16: Git Glossary
Git Glossary! ☕
It’s February 13, 2026, Hyderabad afternoon, and you’ve asked for the Git Glossary — basically a dictionary of all the important words and phrases you’ve been hearing (and will keep hearing) in Git world.
Git has its own official glossary (you can always type git help glossary or visit git-scm.com/docs/gitglossary — it’s updated with every release, current as of Git 2.53.0 from February 2026). But many terms are confusing even after reading the official page because they mix metaphors, old names, and internals.
Today I’ll explain the 30–35 most important terms that beginners (and even intermediate devs) mix up — like a real teacher would, with plain English, why it matters, common confusion, and real tiny examples.
I’ll group them logically so it’s easy to follow.
Core Objects & Data Model Terms
- Repository (Repo) The whole project folder tracked by Git — contains your files + hidden .git/ folder with all history. Example: git init creates a repo in current folder. Types:
- Working (non-bare) — has files you edit
- Bare — no working files, just .git contents (used on servers like GitHub)
- Commit A snapshot of your entire project at one moment + message + author + timestamp + pointer to parent commit(s). Example: git commit -m “Add login page” creates one. Confusion: People say “revision” or “version” — in Git it’s always “commit”.
- Object Git stores everything as one of four types:
- blob — file content (no name or path)
- tree — directory structure (points to blobs & sub-trees)
- commit — snapshot + metadata
- tag — annotated label on a commit You almost never deal with them directly — Git handles it.
- HEAD Where you currently “are” — usually points to the tip of your current branch. Detached HEAD — when HEAD points directly to a commit (not a branch) — dangerous for new commits. Example: git checkout v1.0 → detached HEAD warning.
- Index / Staging Area / Cache The “pre-commit waiting room” — copy of files ready to be committed. Example: git add file.txt puts current version into index.
- Working Tree / Working Directory Your actual files on disk that you edit.
Branch & Reference Terms
- Branch A movable pointer to a commit — represents a line of development. Example: git branch feature/login or git switch -c feature/login
- Main / Master Default branch name (main since ~2020–2022). Production/stable code usually lives here.
- HEAD~1 / HEAD^ Parent commit of current HEAD. Example: git reset –hard HEAD~2 goes back 2 commits.
- Ref / Reference Named pointer to a commit (branches, tags, HEAD, ORIG_HEAD, etc.). Stored in .git/refs/.
- Remote-tracking Branch Local copy of a branch from remote (e.g., origin/main). Example: git fetch updates them.
Remote & Collaboration Terms
- Remote Named connection to another repo (usually GitHub). Default = origin. Example: git remote add origin https://github.com/user/repo.git
- Origin Conventional name for the main remote repo.
- Fetch Download commits/branches from remote — doesn’t merge. Example: git fetch origin
- Pull Fetch + merge (or rebase if configured). Example: git pull origin main
- Push Send local commits to remote. Example: git push origin feature/login
- Upstream / Tracking Branch The remote branch your local branch follows. Set with -u. Example: After git push -u origin feature, git status shows ahead/behind.
Change & History Terms
- Merge Combine another branch into current one. Fast-forward — clean linear history Merge commit — diamond shape with two parents
- Rebase Rewrite history by moving your commits on top of another base. Cleaner but rewrites hashes.
- Cherry-pick Apply one commit from another branch. Example: git cherry-pick abc1234
- Stash Temporarily save uncommitted changes and clean working tree. Example: git stash push -m “WIP dark mode”
- Tag Permanent bookmark on a commit (usually for releases). Annotated tag (-a) recommended — has message & signer.
- Blame / Annotate Show who last changed each line and in which commit. Example: git blame README.md
Conflict & Safety Terms
- Conflict When Git can’t auto-merge because same lines changed differently.
- Detached HEAD HEAD points to commit instead of branch — new commits are “lost” unless you create branch.
- Fast-forward Merge where target branch moves forward without new commit (clean history).
- Reflog Your personal undo log — records where HEAD has been (even lost commits). Example: git reflog → recover with git reset –hard HEAD@{3}
Other Everyday Terms
- .gitignore File listing patterns Git should ignore (node_modules/, .env, etc.)
- SHA / Hash / Object ID 40-char hexadecimal ID of any object (usually short 7-char prefix used).
- Amend Change last commit (message or add forgotten files). Example: git commit –amend
- Squash Combine multiple commits into one (clean history in PRs).
- Rebase Interactive (-i) Reorder, squash, edit, drop commits before sharing.
- DAG (Directed Acyclic Graph) The shape of Git history — commits point to parents, no cycles.
Quick Reference Table – Top 15 Confusing Ones
| Term | Plain English | Common Confusion | Quick Check Command |
|---|---|---|---|
| HEAD | Current position | Detached HEAD means “not on branch” | git status or git branch |
| Index/Staging | Pre-commit box | Not same as working files | git status (green part) |
| Origin/main | Remote main branch copy locally | Not same as local main | git branch -r |
| Fetch vs Pull | Download vs Download+Integrate | Pull = fetch + merge/rebase | git fetch then git log ..origin/main |
| Rebase vs Merge | Rewrite on top vs Join histories | Rebase changes commit hashes | git rebase main vs git merge main |
| Fast-forward | Clean catch-up merge | Only possible if no divergence | git merge –ff-only |
| Upstream | Remote branch your local tracks | Needed for plain git push/pull | git branch -vv |
| Reflog | Safety net / undo history | Expires after ~90 days | git reflog |
Homework: Open terminal → git help glossary → read 5 entries (commit, branch, HEAD, index, remote) → see how official wording matches what we talked about.
Any term still fuzzy? Detached HEAD? Reflog? Rebase vs merge? Just say — we’ll zoom in with a live demo. You’ve come so far — this glossary is your cheat sheet for life! 🚀
