🔀Commit Message
Also known as Git Commit Message, Commit Title, Commit Log Message
The note saved with a commit. It says what changed and why.
Think of it like
Think of it like a note you stick on a box before you store it. It says what is inside and why.
Example
Lucy writes the title Fix the price on the order page. In the body she adds that coupons made tax show twice.
Why it matters
Months later, the message is often the only clue to why a line was changed.
Definition
Example code
console
$ git commit -m "Fix the price on the order page" -m "Coupons made the tax show up twice."
[main 7b8c9d0] Fix the price on the order page
1 file changed, 2 insertions(+), 1 deletion(-)Common mistake
Key takeaways
- 1Short title. No more than 50 characters.
- 2Say why. The diff shows what. Say why.
- 3Blank line. Leave one between title and body.