The Basic Workflow
Add, commit, push - the daily routine

Pixl presents
Add, commit, push. Three commands you will type until your fingers do it in your sleep. Let's get that started.Add, commit, push. Three commands you will type until your fingers do it in your sleep. Let's get that started.

You've got a repository on your computer. Now let's learn how to make changes and actually save them. Git's routine boils down to three steps... add, commit and push.
Think of it like packing a box to mail.
- Add - Put items in the box
- Commit - Seal the box and slap a label on it
- Push - Mail the box
The Three Steps Explained#
Step 1: Add (Stage Your Changes)#
When you change files, Git notices. It does NOT automatically include them in your next save, though. You have to tell Git which changes you want saved.
That's called "staging," because you're getting your changes ready to be saved.
git add filename.txtOr add every changed file in one go.
git add .The period means "everything in this folder."
Step 2: Commit (Save a Checkpoint)#
Once your changes are staged, you save them with a "commit." Each commit is a snapshot of your project at that exact moment.
git commit -m "Add new feature"The -m flag lets you add a message about what you changed. Good commit messages help you (and anybody else) make sense of the project history later.
Good commit messages
- "Add login page"
- "Fix broken link on homepage"
- "Update colors in header"
Bad commit messages
- "stuff"
- "changes"
- "asdfasdf"
(Future you will read "asdfasdf" at 11pm while hunting a bug and want to fight present you.)
Step 3: Push (Upload to GitHub)#
Your commit is saved on your computer, but it's not on GitHub yet. Push sends your commits up to GitHub.
git pushNow your changes are backed up online and showing on your GitHub repository!
Let's Practice#
Time to make a real change to your repository.
Step 1. Make Sure You're in Your Repo#
cd ~/Projects/my-first-repoStep 2. Create a New File#
Let's make a simple text file.
echo "Hello, GitHub!" > hello.txtThat creates a file called hello.txt with the text "Hello, GitHub!" inside.
Step 3. Check the Status#
Git can tell you what's changed.
git statusYou'll see hello.txt listed as an "untracked file," which means Git can see it but isn't tracking it yet.
Step 4. Add the File#
Stage the file for committing.
git add hello.txtRun git status again. Now the file shows up under "Changes to be committed."
Step 5. Commit the Change#
Save your checkpoint.
git commit -m "Add hello.txt file"You'll get a message confirming the commit was created.
Step 6. Push to GitHub#
Send it up to GitHub.
git pushDonezo! Your change is on GitHub now.
Checking Status#
The git status command is your best friend. It tells you a few important things.
- Which files have changed
- Which changes are staged
- Whether you're ahead of GitHub
Run it often! There's no limit, and nobody's counting.
git statusOne habit I'd push on you here. I'm big on "consistency over intensity," and Git rewards it. Small commits, often, with clear messages, beat one giant mystery commit at the end of the day EVERY time.
Seeing What Changed#
Want to see exactly what you changed inside a file? Use git diff.
git diffIt shows added lines (in green) and removed lines (in red).
The Workflow in Pictures#
+--------+ +---------+ +--------+ +------+ +--------+
| Edit |--->| git add |--->| commit |--->| push |--->| GitHub |
| files | | (stage) | | (save) | | | | online |
+--------+ +---------+ +--------+ +------+ +--------+Common Mistakes#

Forgot to add files
If nothing's staged, Git refuses to make the commit at all, and if you only staged some files, the commit will be missing the rest. Run git status before committing.
Wrote a bad commit message Git can reword your most recent commit message as long as you haven't pushed it yet (just ask Claude Code to amend it). Older ones are better left alone, so keep them short and descriptive from the start.
Pushed to wrong repository
Double-check your remote with git remote -v to see where your pushes are going.
Quick Reference#
| Command | What It Does |
|---|---|
git status | See what's changed |
git add filename | Stage a specific file |
git add . | Stage all changes |
git commit -m "message" | Save staged changes |
git push | Upload to GitHub |
git diff | See what changed in files |
TL;DR#
- The Git workflow is three steps, add, commit and push
- Add stages the changes you want to save
- Commit saves a checkpoint with a message
- Push uploads your commits to GitHub
- Use
git statusa lot to see what's going on - Good commit messages help you understand your project history
What's Next?#
You know how to save and share changes now. But what if you want to try something new without messing up your main project? That's what branches are for, and next lesson you'll learn how to make parallel versions of your project...
This lesson ends with a short activity.
