Tracking changes in a project
A “version” is a set of changes.
Saving full snapshots of the project rather than just tracking the individual changes.
Snapshots have to be “efficient” (we’ll clarify this later)
Storage model is based on a Directed Acyclic Graph of Snapshots
Graph: mathematical structure consisting of Nodes (or vertices) connected by Edges (or lines).
Graph: mathematical structure consisting of Nodes (or vertices) connected by Edges (or lines).
Graph: mathematical structure consisting of Nodes (or vertices) connected by Edges (or lines).
Directed: The edges have a specific direction, represented by arrows.
Acyclic: Contains no cycles. You cannot start at any node and follow a path back to the same node.
Common use cases: They are used for showing one-way workflows, data processing pipelines, chronological or causal flows, dependencies, and scheduling.

git allows you to:
Each command is called from the command line following git (e.g. git init).
init: initialize a repository (repo)add: move a file into the staging areacommit: take a snapshot of files in the staging area with a message (-m)push: send commits to another repoinit: invite the photographer (git) to the wedding (repo)add: move the bride and groom into the camera framecommit: take a picture of the bride and groom and caption itpush: share the photos online
git initgit init initializes a git (local) repository.git/.git/ is a hidden folder containing git’s databasegit status: what’s going on with repo
git add: stage changes (framing photo)
git commit -m "...": record changes in git’s database (take a snapshot)
A commit consists of:
Short message: < 50 characters
Longer descriptions
Examples:
What happened, and possibly why something happened
There’s one root commit (initial commit)
Arrows always point backward in time (from the child commit to its parent)
Why? Because a parent commit cannot know its future children, but a child commit always knows exactly who its parent was.
There are no loops or cycles (a child node cannot be the parent of its parent, or the ancestor of its ancestors)
Each commit has a HASH id (and other metadata)
There are moving pointers (or labels) such as:
HEAD: “You are here” bookmarkmain: name of default branchHow does git keep track of changes?
Git records the changes made on a project’s files (not their versions)
