Reference

Git Glossary

A-Z guide to Git terminology. 60 essential terms explained in plain language.

A

Ancestor

A commit that precedes another commit in the history. Parent commits and their parents are all ancestors.

Annotated Tag

A tag that stores extra metadata like the tagger name, email, date, and a message. Recommended for releases.

B

Bare Repository

A repository without a working directory. Contains only the .git folder contents. Used as a central repository for sharing.

Blob

A Git object that stores the contents of a file. Short for "binary large object".

Branch

A movable pointer to a commit. Represents an independent line of development in a repository.

C

Cherry-pick

Copying the changes of one existing commit onto your current branch as a new commit (with a new hash).

Clone

A full copy of a remote repository — every commit, plus remote-tracking branches like origin/main — created with git clone.

Commit

A snapshot of your repository at a specific point in time. Contains a tree, parent commit(s), author, and message.

Commit Hash

A 40-character SHA-1 checksum that uniquely identifies a commit. Can be shortened to 7 characters in most cases.

Conflict

Occurs when Git cannot automatically merge changes because the same lines were modified differently in both branches.

D

Detached HEAD

A state where HEAD points directly to a commit instead of a branch. Changes made here may be lost if not saved to a branch.

Diff

The difference between two versions of a file or set of files. Shows additions, deletions, and modifications.

E

Embedded Repository

A folder with its own .git inside another repository. Git records it only as a pointer to one commit (a gitlink); use submodules instead.

F

Fast-forward

A merge where the branch pointer simply moves forward because there are no divergent commits. No merge commit is created.

Fetch

Downloading new commits and refs from a remote without touching your own branches or working tree.

Fixup

An interactive-rebase action that melts a commit into the one before it and discards its message.

Force with Lease

git push --force-with-lease: overwrite the remote branch only if it still points where you last saw it, so a teammate’s work is never lost.

Fork

A personal copy of another repository on a hosting service. Commonly used in open-source to propose changes via pull requests.

G

Grafted Commit

In a shallow clone, the oldest downloaded commit: its parents exist on the server but were never downloaded.

H

HEAD

A pointer to the current branch reference or commit. Represents your current position in the repository history.

Hook

A script that runs automatically when certain Git events occur, like pre-commit, post-commit, or pre-push.

Hotfix

An urgent fix for released code, usually made on the release branch, tagged, and then carried back to main.

Hunk

One block of changed lines in a diff, with a few unchanged context lines around it. git add -p stages hunk by hunk.

I

Index

Also called the staging area. An intermediate area where changes are prepared before being committed to the repository.

Interactive Rebase

git rebase -i: rewrite a series of commits by editing a todo list (pick, reword, squash, fixup, drop).

L

Lightweight Tag

A simple pointer to a commit without any additional metadata. Just a name for a specific commit.

M

Main/Master

The default primary branch in a repository. "main" is the modern convention, "master" is the legacy name.

Merge Commit

A commit with two or more parents that combines changes from different branches into one.

Merge Conflict

When Git cannot automatically resolve differences between two branches. Requires manual resolution by the developer.

O

Object

The fundamental storage unit in Git. Four types exist: blob (file), tree (directory), commit, and tag.

ORIG_HEAD

A ref Git sets before risky operations (reset, merge, rebase) to where HEAD was — git reset --hard ORIG_HEAD undoes them.

Origin

The default name for the remote repository from which you cloned. Points to the original source.

P

Parent Commit

The commit that directly precedes another commit. Merge commits have multiple parents.

Pathspec

A pattern used to limit paths in Git commands. Can include wildcards and directory specifications.

Prune

Removing remote-tracking branches whose branch no longer exists on the remote (git fetch --prune).

Pull

git fetch followed by merging (or rebasing) the fetched upstream into your current branch.

Pull Request

A hosting-platform request (GitHub, GitLab…) to review and merge one branch into another. Not a Git command itself.

Push

Uploading your commits to a remote and moving its branch to match yours.

R

Rebase

Replaying commits on top of another base commit, producing new commits and a linear history.

Ref

Short for reference. A pointer to a commit, such as a branch name, tag, or HEAD.

Reflog

A log of all reference updates in your local repository. Records when branch tips and HEAD change.

Release Branch

A branch that holds a shipped version so fixes can be made on it while main moves on.

Remote

A version of your repository hosted elsewhere (like GitHub, GitLab). Used for collaboration and backup.

Remote-Tracking Branch

A read-only local bookmark of a remote branch, such as origin/main, updated by fetch, pull and push.

Repository

A directory containing your project files and the entire Git history stored in a .git folder.

Revert

A new commit that undoes the changes of an earlier one, without rewriting history — safe on shared branches.

S

SHA-1

The cryptographic hash function Git uses to generate unique identifiers for commits and objects.

Shallow Clone

A clone with only the newest commits (git clone --depth N), common in CI; deepen it with fetch --depth or --unshallow.

Signed Commit

A commit carrying a GPG (or SSH) signature that hosts can show as “Verified”. Created with git commit -S.

Squash

Combining several commits into one, e.g. with interactive rebase or git merge --squash.

Staging Area

The intermediate area between your working directory and repository where you prepare commits. Also called the index.

Stash

A temporary shelf for uncommitted changes (git stash), so you can switch tasks with a clean working tree.

Submodule

A repository embedded inside another repository. Useful for including external dependencies at a specific version.

T

Tag

A named reference that points to a specific commit. Typically used to mark release versions like v1.0.0.

Tracking Branch

A local branch that has a direct relationship to a remote branch. Enables push/pull without specifying the remote.

Tree

A Git object that represents a directory. Contains references to blobs (files) and other trees (subdirectories).

U

Untracked File

A file in the working directory that Git is not monitoring. Not included in commits until explicitly added.

Upstream

The remote branch that a local branch is tracking. The source from which changes are pulled.

W

Working Directory

The directory on your file system where you edit files. Contains the current checkout of your project.

Working Tree

Another name for the working directory. The files you see and edit in your project folder.