WeCodeAcademy

Writing Good Commits

A good commit does one thing and has a message you will understand in six months. Write it as an instruction: "Add login form", not "stuff" or "fixed it".

Examplebash
Open in editor »
/ $

Two small commits tell a clearer story than one big one. Use git add <file> for just the files that belong together.

Quick check

Which commit message is best?

Your turn: write the code

Make two commits with the messages Add login page and Add signup page. Print how many log lines mention login.

Finish the quick check (and any code exercise) to complete this lesson, or mark it done yourself.

Tip: use the left and right arrow keys to move between lessons.