June 15, 2026 · by Meegrow Labs

What Does git commit Do? Save a Checkpoint

You picked your files with git add. They are staged and ready. But here is the catch: they are not saved yet. If you walked away now, nothing would be locked in.

The git commit command saves your staged changes as one permanent snapshot of your project, with a short note so you can find it again later.

What does git commit do?

Think of a video game. You reach a tricky point. You hit the save button, and sometimes you even name the save. Now you can always come back to that exact moment.

A git commit is that save button for your code. It takes everything you staged and freezes it into a single snapshot. Each commit is a checkpoint, a point in your project you can always return to.

How do I write the command?

The command is short. You type it in your terminal:

git commit -m "first"

Let us read it piece by piece, so nothing feels like magic:

  • commit means “save a snapshot.”
  • -m is a flag that lets you add a message.
  • "first" is the label, written in quotes. It is just a short note to your future self.

All your staged changes get bundled together and freeze into one snapshot, with the name you chose attached.

Why does the commit message matter?

The message is how you remember what a checkpoint was for. Six months from now, “first” will not mean much. So as you go, write clear messages like "add login button" or "fix UPI payment bug."

Future you will thank you. When you scroll back through your project’s history, good messages turn a list of snapshots into a readable story of how your work grew.

How do I try it right now?

If you already have a folder where you ran git init and staged a file with git add, you are ready. Open a terminal and type:

git commit -m "first"

That saves a snapshot of your staged work. You have just created your first checkpoint, a save point with a little note attached, that you can come back to anytime.

Key takeaways

  • git commit saves your staged changes as one permanent snapshot.
  • The full command is git commit -m "your message"; the -m flag adds a short label.
  • Each commit is a checkpoint you can always return to, like a save point in a game.
  • Write clear, specific messages so future you understands the history.

This lesson follows on from choosing your files with git add, and next we put it together in a quick edit, add, commit cycle. Want the full path from “what’s a file?” to building real apps with AI? Take the free Zero to AI Hero course and learn step by step, in plain Hindi and English.


🚀 Take the full free course: Zero to AI Hero — learn to build with AI from scratch. New lessons daily, in Hindi & English.

Meegrow Labs

We help India go from zero to AI hero — learn to use & build with AI from scratch, in Hindi & English. Start the free course →

Want to actually learn this?

151 free 2-minute lessons — from "what's a file?" to building with AI.

▶ Start the free course