Git

Sefism.

A to Z

Glossary

Every concept in this sheet, plus the smaller terms it uses. Select a concept to open its card.

B
Blobs, trees and hashes
Git stores file contents as blobs, folders as trees and snapshots as commits, each addressed by a hash of its content.
Branches and refs
A branch is just a named pointer to a commit.
C
Commit
A snapshot of the whole project at one moment, plus an author, a message and a pointer to its parent commit (two parents for a merge).
G
git add
Stages changes into the index.
git commit
Records the staged snapshot as a new commit on the current branch.
git config
Sets options at three levels: system, global (your user, in ~/.gitconfig) and local (one repository).
git diff
Shows line changes.
git init and git clone
git init turns a folder into a new repository.
git rm and git mv
git rm deletes a file and stages the deletion; git rm --cached stops tracking it but keeps it on disk.
git status
Shows the current branch, how it compares with its upstream, and which files are staged, modified or untracked.
H
HEAD and detached HEAD
HEAD is the pointer to what you have checked out, normally a branch name.
R
Repository
A project folder tracked by Git.
S
Staging area
A draft of the next commit.
W
Working tree
The files you see and edit on disk, checked out from one commit.
10 · Glossary, A to Z10 / 10