1The problem before the tool
Picture a client proposal sitting on a shared drive. Someone drafts it as proposal.docx.
Someone else adds pricing and saves it as proposal_v2.docx. A third person fixes a typo and,
not sure which version is current, saves proposal_v2_FINAL.docx. A week later a client
calls about a number that turns out to belong to neither file: it was typed into a copy nobody renamed
at all, now sitting three folders away, and the only way to find it was to remember who had it open
last Tuesday.
Nothing about that process was careless. It is simply what happens when a tool is asked to track change and was never built to. The filename is doing a job it cannot do: saying what changed, when, and why, across everyone who touched the file.
Git keeps every version of a project automatically, tied to who made it, when, and a sentence about why, with nothing to rename and nothing to remember. You do not choose between keeping the old version and keeping the new one. Git keeps both, forever, and lets you ask for either.
2What git actually is
Git is a program that runs on your own computer and watches one folder, called a
repository, or repo for short. This folder you are reading
these notes from, HN - Training, is a repository. Inside it sits an ordinary folder
named .git that most file browsers hide by default. That hidden folder is the entire
history. Delete every other file in the project and keep only .git, and nothing is
lost. Delete .git and keep everything else, and the history is gone, though the
current files remain.
When you decide a change is worth keeping, you tell git to record it. That record is called a commit, and a commit is a complete snapshot of every file in the project at that moment, not a description of what changed. Git works out the difference between two snapshots whenever you ask it to show you one, which is why it can tell you exactly what changed in any file between any two points in the project's life, including files nobody has opened in years.
Line the snapshots up in the order they were made and you get the project's history. Section 4 reads this training site's real history, five commits long so far, so the idea has a concrete example before the next session adds GitHub to it.
3What git is not
Not a backup service
A backup copies files on a schedule, whether or not anything meaningful happened. Git records a version only when you tell it to, and only the files you tell it to. If you never run the command to record a change, git has no idea the change exists. The upside is control: a half-finished, embarrassing draft never becomes part of the history unless you choose to put it there.
Not GitHub
Git is the program that tracks history on your own machine. GitHub is a separate website that stores a copy of that history so other people can get to it. You can use git with no GitHub account at all, tracking a project that only ever lives on one computer. Session 02 covers what GitHub adds and why Hermetic uses it.
Not automatic
Nothing is recorded until you ask. Editing a file does not create a commit. Saving a file does not create a commit. The daily habit in session 03 is exactly this: noticing you have made a change worth keeping, and telling git so.
Not built for every file type
Git is built to track text: code, HTML, configuration, plain documents. It can hold a photo or a spreadsheet, but it can only tell you that the whole file changed, not what changed inside it the way it can for text. This site keeps its pages as HTML for exactly that reason, among others.
4Five real commits
This is the actual history of the repository you are reading right now, oldest first, exactly as git reports it:
| Order | Short hash | Message |
|---|---|---|
| 1 | 10cdf79 | Initial Commit |
| 2 | 473faf6 | Create .gitignore |
| 3 | 34ea44c | Removing epubs |
| 4 | aae9cfe | Library view on mobile |
| 5 | da57a3f | Updated library button |
Each short hash is the first seven characters of a much longer fingerprint git calculates from the snapshot's contents. Two different snapshots never produce the same hash, so the hash is also how git tells commits apart and refers to one exactly, the way a check number refers to one payment. Each message is one line the person who made the commit wrote, by hand, to say what that snapshot changed. Session 03 covers what makes a message like "Library view on mobile" more useful six months from now than one like "fix stuff".
This site is young. Every push from here forward adds another row to this table, and it never shrinks. By the time this course has been taught twice, this table will be out of date and the real command in the lab below will show far more than five.
5Why this is worth 45 minutes
You do not need to become a software engineer to get real value from this. Anyone who edits this training site, or any future project kept the same way, gets three things from the habit: a change that goes wrong can be pointed at and undone, because the snapshot before it still exists; two people can work on the same project without emailing files back and forth, because branches, in session 04, give each person their own line of work; and a change to something as sensitive as a page that is only supposed to be visible to Hermetic staff is recorded, with a name and a timestamp attached, which matters the moment something needs to be traced back.
6Try it: read, don't write
Everything in this lab only reads the repository. None of it changes a single file, so there is
nothing to undo and nothing to be careful about. Open a terminal in the HN - Training
folder and run each of these in order.
- Run
git log --oneline. Confirm you see the same five lines as the table in section 4, in the same order, newest at the top. - Run
git log -1 --stat. This shows the single most recent commit and which files it touched. Name one file it changed. - Run
git show 10cdf79(or whatever the first hash is by the time you try this). Git shows you that entire commit. Scroll to the top and find the author line and the date. - Run
git status. If nothing is in the middle of being changed, git reports a clean working tree. Keep that phrase in mind; session 03 uses it constantly.
From session 04 onward, the labs ask you to create and switch branches, which does change files.
Rather than practice that on this live site, create a throwaway folder now, anywhere outside
HN - Training and outside any OneDrive-synced folder (session 08 explains why that second
part matters), and run git init inside it. That folder is yours to break freely for the
rest of this course.
7Check for understanding
-
Answer
Git keeps one file under one name. What changes is that every version that file has held is kept as a snapshot in the project's history, reachable on request, rather than kept or lost depending on who remembered to save a copy.
-
Answer
A commit is a complete snapshot: every file in the repository as it stood at that instant, whether or not that particular file changed since the last commit. Git works out any difference you ask to see afterward, by comparing two snapshots.
-
Answer
Git does nothing on its own. Priya's edits exist on disk, and git can see that something has changed if she runs
git status, but no commit exists, and no history entry exists, until she deliberately records one. Session 03 is this exact habit. -
Answer
.git is not a label or a convenience copy. It is the actual storage for every commit the repository has ever recorded. The files you can see in the folder are only the current snapshot, checked out for you to work with. Delete .git and the history is gone unless a copy of it exists somewhere else, such as on GitHub, which session 02 covers.
-
Answer
The snapshot itself is unaffected. What a vague message costs is readability later: six months from now, "fix stuff" tells nobody, including the person who wrote it, what that commit actually changed or why, which means they have to open the full commit just to find out. Session 03 covers what a message should say instead.
8Before session 02
- Run the four commands in section 6 and keep the output; session 02 picks up from the same repository.
- Create the practice folder described in the aside in section 6, outside both
HN - Trainingand any OneDrive folder, and confirmgit initran without an error. - Notice, next time you open this training site in a browser, that you had to sign in. Session 02 is about what makes that happen and what it has to do with git.
9Glossary
- Version control
- Software that records a project's history over time so any earlier state can be found again.
- Repository (repo)
- A folder git is tracking, made of the current files plus a hidden .git folder holding the full history.
- Commit
- A recorded snapshot of every file in the repository at one moment, with an author, a timestamp and a message.
- Hash
- The fingerprint git calculates from a snapshot's contents, used to refer to that exact commit. The short hash is its first seven characters.
- History
- Every commit a repository has, in order, each one still reachable.
- Working tree
- The actual files on disk right now, as opposed to any past snapshot of them.
- Clean working tree
- The state git reports when nothing in the working tree differs from the most recent commit.
10Sources
- Scott Chacon and Ben Straub, Pro Git, 2nd edition, chapter 1, "Getting Started", on what version control is and what git adds to it. Free to read online.
- GitHub, What is GitHub?, for how the next session's tool fits in.
- Commit history is from this repository,
HN - Training, read withgit logon 2026-10-03.