Git & GitHub Interview Question #15

What makes a good Git commit message?

Git Fundamentals, Repository, Working Tree, Staging, Commits & Branch Basics Junior Beginner

Quick Interview Answer

A good commit message is concise, specific, and describes the purpose of the change. The subject should help another developer understand the history without opening every diff.

Detailed Explanation

A good commit message is concise, specific, and describes the purpose of the change. The subject should help another developer understand the history without opening every diff.

For larger changes, teams may use a short subject followed by a body explaining motivation, tradeoffs, or related issue information. Repository conventions should be followed consistently.

Code Example

git commit -m "Fix mobile overflow on interview question page"