CodeBlanks Logo Icon CodeBlanks

Good commit message

Learn what makes a good commit message.

Characteristics of a Good Commit Message

A good commit message should be concise, clear, and descriptive of the change. It should make it easy to understand what the change does or why it was made.

Add search filter

Imperative and Conventional Commits

With the imperative style, a message describes an action, such as Update the menu. Conventional Commits uses types such as feat: and fix: to identify the nature of a change.

feat: add search field
fix: correct login error

Practice Create Conventional Commit Messages

Create two Conventional Commit messages for a new feature and a bug fix. Store them in featureMessage and fixMessage, then print them on separate lines.

Starter code

terminal
// Özellik mesajını oluştur
let featureMessage;

// Hata düzeltme mesajını oluştur
let fixMessage;

// Mesajları yazdır

Sample solution

terminal
let featureMessage = 'feat: profil sayfası ekle';
let fixMessage = 'fix: bağlantı hatasını düzelt';

console.log(featureMessage);
console.log(fixMessage);

Expected output

feat: profil sayfası ekle
fix: bağlantı hatasını düzelt

Questions and answers

Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.

1 Which of the following is a better commit message?

  • Update
  • Files changed
  • Add validation to login form Correct answer
  • Did some stuff

Explanation: A good message clearly states the change. Generic phrases do not explain its purpose.

2 Complete the Conventional Commits Type

Question
Yeni bir özellik ekleyen commit mesajı ____ ile başlayabilir.
Answer
Yeni bir özellik ekleyen commit mesajı feat: ile başlayabilir.

Explanation: <code>feat:</code> is used to identify changes that introduce a new feature.

3 Match Commit Message Principles

Term Meaning
imperative Action-oriented wording
concise Remove unnecessary words
feat: New feature type
fix: Bug fix type

All lessons in Beginner