A hands-on guide
Git remembers useful checkpoints in your work. It lets you try ideas on a side path, combine them when you are ready, and recover when something goes wrong.
Your folder
The work in progress
A checkpoint
A saved version you name
A side path
A safe place to experiment
Git is the version tracker on your computer. GitHub is one place to host a shared copy online. Git works without GitHub, and you can use GitHub without knowing every Git command.
01 · The basic loop
Git gives you control over what gets saved. You edit in your project folder, select the changes you want to keep, then make a checkpoint called a commit.
Make one change, then save it
A pretend project. Nothing on your computer is changed.
Your folder
Where you edit
home.html
The page content
colors.css
How the page looks
Staging list
What goes in the next checkpoint
Checkpoints
Saved moments in the project
Project created
current point
Nothing is waiting to be saved. Your project folder and its last checkpoint match.
Everyday Git words: status asks what changed; diff shows the edits; add stages selected edits; commit saves the checkpoint.
You do not have to stage every file together. That small pause before a commit helps you leave out an unfinished or unrelated change.
02 · Experiment safely
A branch starts from a checkpoint and gives your next commits their own path. You can keep the main version steady while you test a new idea.
The main branch is the shared line of work. Start with a copy of its latest checkpoint.
Repository
The project folder plus the history Git keeps with it.
Commit
A named checkpoint. It records who saved it, when, and why.
Branch
A movable name for one line of work, such as main or try-new-colors.
The branch is not a separate project copy. It is a lightweight pointer to a series of commits. Switch branches to move between lines of work.
04 · When paths meet
If two people change different parts of a project, Git can often combine the work automatically. If they change the same part, it pauses so a person can decide what the final version should say.
Maya's branch
The open studio begins at 09:30.
Leo's branch
The open studio begins at 10:00.
Git pauses here
Both people changed the same line. Git cannot know which time is right, so it asks a person to choose or combine them. Neither person's change is silently discarded.
Your resolved version
Choose which wording belongs in the final version.
05 · Recover with care
Git has several ways to go back. Choose the situation that sounds like yours to see the difference.
What happened?
A matching tool
Revert makes a new checkpoint that reverses the earlier one. It keeps the shared history intact, which is why it is usually the clearest choice for work other people already have.
git revert <commit>
Usually the safest undo for shared work.
06 · The vocabulary
These are the labels people use for the pieces you just explored. You can understand the workflow before memorising any commands.
07 · Try it yourself
Three small questions to see whether the model makes sense. Guessing is part of learning.
Question 1 of 3
Keep building
Return to the Coding for Non-Coders guide for project ideas, tools, and practical ways to build with AI.