Ad space (banner)
🌿Git Lessons
Lesson 5 / 59

Recording Changes with git commit

This lesson covers recording changes with git commit. It's for anyone searching "git commit usage."

git commit takes what's in staging and records it as an official point in history. -m "message" attaches a note about what you did, alongside it — build the habit of writing a clear message, since it's what you'll rely on when reviewing history later.

In Try It, run git commit -m "Initial commit". Think of a commit like a save point in a video game — you can always return to that exact point later.

A common early mistake is writing a lazy, low-effort commit message. Recording "what" and "why" in the message means the intent is still clear months later when you look back — and in real teams, commit message conventions are often part of the team's shared rules, since a message another developer can understand at a glance is genuinely valued.

Git
Try it (type this into the pseudo terminal)
git commit -m "Initial commit"

🧑‍💻 You can type this command into the Git pseudo terminal to try it yourself (this page itself has no interactive terminal).

Ad space (banner)
Ad space (in-article)