The daily loop: edit, add, commit
Ninety-nine percent of using git is these three moves, repeated for years.
The loop is edit → status → add → commit, and it never changes — everything else in git is built around it.
01The loop, spelled out
Everything you have learned compresses into one habit. You edit files — that is your actual work, the reason for all of this. Then you check what changed with git status. You stage what belongs together with git add .. You take the photograph with git commit -m "...". Then you do it again, and again, all day, for years.
Each trip around the loop takes about ten seconds and buys a permanent, labelled save point. Ten seconds now is the price of being able to answer any question about your project's past, forever.
# ...you work on files...
git status # see what changed
git add . # stage it
git commit -m "say what you did"
git status # clean againOne idea per commit. If you fixed a typo and added a new page, that is two commits. Small photographs are easy to read, easy to explain, and — if one turns out to break something — easy to undo without losing the rest.
02What a day really looks like
A morning of real work produces a rhythm like this: edit, status, add, commit, edit, status, add, commit. The commits pile up as short lines in the log — a diary of your project, written in ten-second instalments. At the end of the day, git log --oneline shows the story of what you did, and git status shows a clean tree: everything saved, nothing hanging.
Notice git status bookends the loop. Before, it tells you what changed so you can stage deliberately. After, it confirms everything landed. When anything in git ever feels confusing — now, or in five years — the first move is the same: run status, read it, breathe.
9:00 git commit -m "fix crash when list is empty"
10:30 git commit -m "add dark mode toggle"
12:15 git commit -m "refactor save button"
17:00 git commit -m "start settings page"The natural moments to commit: a fix works, a feature lands, you are about to try something risky. Those pauses are exactly what the messages will describe later.
Practice
A todo list project is ready. Run the loop twice.
01.Add a new line to todo.txt (use >> to append, not >).
hint: Try: echo "buy milk" >> todo.txt
02.Commit the change.
hint: git add . then git commit -m "add milk"
03.Create a second file shop.txt and commit it too.
hint: echo "the shop is closed" > shop.txt then stage and commit