Module 9: Introduction to Git

Lesson 3 of 5 · 15–25 minutes

Commits

🏠The everyday picture

A photograph of the whole project at one moment, with a caption on the back: "Added the contact page." A commit is that photo.

📘What it really is

🖱️Try it

git add index.html .gitignore
git commit -m "Start my first site"
git status

git status should now say "nothing to commit, working tree clean". That means everything is saved in history.

✅Quick check

Which is the better commit message: "changes" or "Fix the broken link on the home page"? Why?

Show the answer

The second. In six months, it tells you exactly what that commit did without opening it.

Why commit small and often instead of once at the end of the day?

Show the answer

Each small commit is easy to understand and can be undone on its own, without losing the rest of the day's work.

← PreviousRepositories
ProLearners Assist