Git - Glossary

Reference

A comprehensive glossary of Git terms, concepts, and terminology. Use this reference to understand Git vocabulary and communicate effectively about version control concepts.

Core Concepts

A

Annotated Tag
A tag object that contains metadata (tagger, date, message) and points to another object.
Example: git tag -a v1.0 -m "Version 1.0"

Ancestor
A commit that appears earlier in the project history.

Author
The person who originally wrote the code in a commit.

Ahead/Behind
Branch comparison terms. "Ahead" means commits exist locally but not on remote. 
"Behind" means remote has commits not in local branch.

B

Bare Repository
A repository without a working directory, typically used as a central repository.
Created with: git clone --bare or git init --bare

Binary File
A non-text file that Git treats as indivisible content.

Bisect
Binary search through commit history to find when a bug was introduced.
Commands: git bisect start, git bisect good, git bisect bad

Blob
Git object type that stores file content without metadata.

Branch
A movable pointer to a specific commit, representing a line of development.
Commands: git branch, git checkout -b

Bundle
A file containing Git objects and refs, used for offline repository transfer.
Command: git bundle create

C

Cache
Another term for the staging area or index.

Cherry-pick
Apply changes from specific commits to current branch without merging.
Command: git cherry-pick <commit>

Clone
Create a copy of a repository from a remote source.
Command: git clone <url>

Commit
A snapshot of the repository at a specific point in time.
Also: the act of creating such a snapshot.

Commit Object
Git object containing tree reference, parent commits, author, committer, and message.

Committer
The person who last applied the change (may differ from author).

Conflict
When Git cannot automatically merge changes from different sources.

Conflict Markers
Special text markers (<<<<<<<, =======, >>>>>>>) showing conflicting changes.

D

Dangling Object
A Git object not referenced by any branch, tag, or other object.

Detached HEAD
State where HEAD points to a commit instead of a branch.

Diff
Shows differences between commits, branches, or working directory.
Commands: git diff, git diff --cached

Dirty
A working directory with uncommitted changes.

Distributed Version Control
System where every repository contains complete project history.

F

Fast-forward
A merge type where branch pointer simply moves forward without creating merge commit.

Fetch
Download objects and refs from remote repository without merging.
Command: git fetch

Fork
A personal copy of another user's repository (GitHub/GitLab concept).

Fsck
File system check - verify integrity of Git objects.
Command: git fsck

G

Garbage Collection
Process of removing unreachable objects to optimize repository.
Command: git gc

Git Directory
The .git directory containing repository metadata and object database.

Gitignore
File (.gitignore) specifying which files Git should ignore.

GUI
Graphical User Interface tools for Git (GitKraken, SourceTree, etc.).

H

Hash
SHA-1 checksum uniquely identifying Git objects.

HEAD
Reference to the current branch or commit being worked on.

Hook
Script that runs automatically at specific Git events.
Types: pre-commit, post-commit, pre-push, etc.

Hunk
A contiguous group of changes in a diff.

I

Index
Staging area where changes are prepared before committing.
Also called: cache, staging area.

Interactive Rebase
Rebase mode allowing editing of commit history.
Command: git rebase -i

Issue
Bug report or feature request (GitHub/GitLab concept).

L

LFS (Large File Storage)
Git extension for handling large binary files efficiently.

Lightweight Tag
Simple pointer to a commit without additional metadata.
Command: git tag v1.0

Log
Command showing commit history.
Command: git log

M

Master/Main
Default primary branch name (master traditionally, main increasingly common).

Merge
Combine changes from different branches.
Commands: git merge, git merge --no-ff

Merge Commit
Commit with multiple parent commits, created by merging branches.

Merge Conflict
When Git cannot automatically combine changes during merge.

Mergetool
External tool for resolving merge conflicts.
Command: git mergetool

O

Object
Fundamental data unit in Git (blob, tree, commit, tag).

Object Database
Storage system for Git objects in .git/objects directory.

Octopus Merge
Merge with more than two parent commits.

Origin
Default name for primary remote repository.

Orphan Branch
Branch with no commit history.
Command: git checkout --orphan

P

Pack File
Compressed format for storing multiple Git objects efficiently.

Parent
Previous commit(s) in the repository history.

Patch
Text representation of changes that can be applied to files.
Commands: git format-patch, git apply

Plumbing
Low-level Git commands (internal, scripting-oriented).

Porcelain
High-level Git commands (user-facing).

Pull
Fetch and merge changes from remote repository.
Command: git pull

Pull Request (PR)
Request to merge changes from one branch to another (GitHub/GitLab).

Push
Upload local commits to remote repository.
Command: git push

R

Rebase
Reapply commits on top of another base commit.
Commands: git rebase, git rebase -i

Ref
Reference to an object, typically stored in .git/refs/.

Reflog
Log of reference changes, useful for recovery.
Command: git reflog

Refspec
Specification for mapping remote refs to local refs.

Remote
Repository copy in another location (typically on server).
Commands: git remote add, git remote -v

Repository
Collection of files and their complete history managed by Git.

Reset
Move branch pointer and optionally update working directory.
Commands: git reset --soft, git reset --mixed, git reset --hard

Resolve
Fix merge conflicts to complete merge process.

Revert
Create new commit that undoes changes from previous commit.
Command: git revert

S

SHA-1
Cryptographic hash function used to identify Git objects.

Shallow Clone
Repository copy with limited commit history.
Command: git clone --depth 1

Squash
Combine multiple commits into single commit.
Used in: git rebase -i, git merge --squash

Stage
Add changes to the index/staging area.
Command: git add

Staging Area
Intermediate area where changes are prepared before committing.
Also called: index, cache.

Stash
Temporarily save uncommitted changes.
Commands: git stash, git stash pop

Submodule
Repository embedded within another repository.
Commands: git submodule add, git submodule update

Subtree
Include another repository as subdirectory.
Commands: git subtree add, git subtree pull

T

Tag
Named reference to specific commit, typically for releases.
Commands: git tag, git tag -a

Three-way Merge
Merge using common ancestor as base for comparison.

Tracking Branch
Local branch connected to remote branch.
Set with: git branch --set-upstream-to

Tree
Git object representing directory structure.

Tree-ish
Object that can be resolved to a tree (commit, tag, etc.).

U

Unmerged
Files with unresolved merge conflicts.

Unstage
Remove changes from staging area.
Command: git reset HEAD

Untracked
Files in working directory not yet added to Git.

Upstream
Remote branch that local branch tracks.
Set with: git branch --set-upstream-to

W

Working Directory
Directory containing checked-out files from repository.
Also called: working tree.

Working Tree
Files currently checked out from repository.
Same as: working directory.

Worktree
Additional working directory for same repository.
Commands: git worktree add, git worktree list

Command Categories

Basic Commands

git init        # Initialize repository
git clone       # Copy repository
git add         # Stage changes
git commit      # Save changes
git status      # Show working tree status
git log         # Show commit history
git diff        # Show differences

Branching and Merging

git branch      # List/create/delete branches
git checkout    # Switch branches
git switch      # Switch branches (newer)
git merge       # Merge branches
git rebase      # Reapply commits
git cherry-pick # Apply specific commits

Remote Repository

git remote      # Manage remote repositories
git fetch       # Download from remote
git pull        # Fetch and merge
git push        # Upload to remote

Undoing Changes

git reset       # Reset current HEAD
git revert      # Create reverse commit
git checkout    # Restore files
git restore     # Restore files (newer)
git clean       # Remove untracked files

Inspection and Comparison

git show        # Show objects
git log         # Show commit logs
git diff        # Show differences
git blame       # Show line-by-line changes
git bisect      # Binary search for bugs

Git Workflow Terms

Git Flow

Feature Branch - Branch for developing new features
Develop Branch - Integration branch for features
Release Branch - Branch for preparing releases
Hotfix Branch - Branch for urgent production fixes
Master/Main Branch - Production-ready code

GitHub Flow

Feature Branch - Branch for all new work
Pull Request - Request to merge feature
Code Review - Review process before merge
Main Branch - Always deployable code

File States in Git

Untracked - Files not yet added to Git
Tracked - Files known to Git
  ├── Unmodified - Unchanged since last commit
  ├── Modified - Changed but not staged
  └── Staged - Changed and ready to commit

Common Acronyms

VCS - Version Control System
DVCS - Distributed Version Control System
SCM - Source Code Management
PR - Pull Request
MR - Merge Request (GitLab)
CI/CD - Continuous Integration/Continuous Deployment
LFS - Large File Storage
GUI - Graphical User Interface
CLI - Command Line Interface
SHA - Secure Hash Algorithm

Git Configuration Levels

System - Configuration for all users on system
  File: /etc/gitconfig or C:\Program Files\Git\etc\gitconfig
  Command: git config --system

Global - Configuration for current user
  File: ~/.gitconfig or C:\Users\{user}\.gitconfig
  Command: git config --global

Local - Configuration for specific repository
  File: .git/config
  Command: git config --local

Exit Codes

0 - Success
1 - General error
125 - Git bisect skip (cannot test this commit)
126 - Command not executable
127 - Command not found
128 - Fatal error (Git-specific)

Environment Variables

GIT_AUTHOR_NAME - Override author name
GIT_AUTHOR_EMAIL - Override author email
GIT_COMMITTER_NAME - Override committer name
GIT_COMMITTER_EMAIL - Override committer email
GIT_EDITOR - Set default editor
GIT_PAGER - Set default pager
GIT_DIR - Path to .git directory
GIT_WORK_TREE - Path to working directory

Quick Reference Tips

Remember:
  • HEAD always points to current commit/branch
  • Origin is the default remote name
  • Master/Main is the default branch name
  • Staging area = Index = Cache (same thing)
  • Working directory = Working tree (same thing)
  • Commit hash = SHA-1 = Object ID (same thing)

Symbols and Notation

^ - Parent commit (HEAD^ = parent of HEAD)
~ - Ancestor commit (HEAD~3 = 3 commits before HEAD)
.. - Range (main..feature = commits in feature not in main)
... - Symmetric difference (main...feature = unique to each branch)
@ - Shorthand for HEAD
- - Previous branch (git checkout -)
-- - Separate options from paths

This glossary serves as a comprehensive reference for Git terminology. Bookmark this page and refer to it when encountering unfamiliar Git terms in documentation, tutorials, or team discussions.