Zero-Code AI App BuilderZero-Code AI App Builder
Builder Foundations

Your first commit

Save a snapshot of your project

A commit is one save point for your project. In this lesson you'll turn a folder into a Git repository and save your first snapshot.

What is a commit?

Imagine taking a photo of your desk every evening. If something goes missing later, you look at the photos and see exactly how things were. A commit is that photo, but for your project files.

  • It stores how every file looked at that moment
  • It has a short message, like "Add login page"
  • It has your name and the date

Step 1: Create a repository

Make a practice folder and open it in the terminal. You can also use any folder from earlier lessons, like your project notes.

bash
mkdir my-first-repo
cd my-first-repo
git init

Let's break this down:

  • mkdir makes a new folder
  • cd moves you into that folder
  • git init tells Git to start watching this folder. It creates a hidden .git folder that stores the history

Now create a small file. Open the folder in VS Code and add a README.md with one line, like # My first repo.

Step 2: Check the status

git status is your "what's going on?" command. Use it often.

bash
git status
Output
Untracked files:
  README.md

nothing added to commit but untracked files present

"Untracked" means Git sees the file but is not saving it yet.

Step 3: Stage and commit

First, put your changes in the staging basket. Then save them with a message.

bash
git add .
git commit -m "Add README with project title"
  • git add . stages every changed file in this folder. The dot means "everything here"
  • git commit -m "..." saves the snapshot with your message
Edit files
you or the AI
→
git status
see what changed
→
git add .
stage
→
git commit
save point
The full loop you will repeat many times a day.

Run git status again. It should say nothing to commit, working tree clean. That means everything is saved.

Writing good commit messages

Your messages are notes to your future self. In two weeks, you'll want to find "the version before the cart broke". Good messages make that easy.

  • Start with a verb: Add, Fix, Update, Remove
  • Say what changed, not how you felt
  • Keep it under about 60 characters
Good messages
Add habit list to home page
Fix streak count resetting at midnight
Update button colors to match brand

Let AI make the commit for you

AI coding tools can run Git for you. In Claude Code, you can simply ask:

Prompt
Look at what changed since the last commit.
Stage everything and commit it with a short, clear message
that starts with a verb.

Browser builders like Lovable also save commits for you when you connect GitHub. You'll see this when you use an AI app builder.

Even when AI commits for you, read the message it writes. If it does not describe the change, ask for a better one.

Common mistakes

  • Wrong: git commit -m "stuff". Right: git commit -m "Add dark mode toggle".
  • Wrong: running git init in your whole home folder. Right: run it inside one project folder.
  • Wrong: forgetting git add, then wondering why the commit is empty. Right: run git status to check what is staged.
  • Wrong: one giant commit after a full day of work. Right: small commits after each working step.

Practice

Try these exercises to lock in what you just learned.

Quiz
Not started
You edited two files and want to save a snapshot. Which order of commands is correct?
Quiz
Not started
Which commit message is the most useful for your future self?
Quiz
Not started
You're not sure which files have changed or are ready to commit. Which command tells you?

What's next?

You have a save point. Next, in History and undo, you'll learn how to look back at your commits and go back when something breaks.