Commit-editmsg May 2026
In the quiet hours of 2:00 AM, a lone developer typed git commit and was suddenly pulled from their terminal into the stark, blinking world of COMMIT-EDITMSG.
When you run git commit without the -m option, Git opens your default text editor (set via $EDITOR or git config --global core.editor) and loads the contents of COMMIT_EDITMSG. After you write your commit message, save it, and exit the editor, Git reads the contents of this file and uses them as the final commit message. COMMIT-EDITMSG
feat: Add user authentication logic
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch main
# Changes to be committed:
# modified: src/auth.py
# new file: src/user.py
#
# ------------------------ >8 ------------------------
# Do not modify or remove the line above.
# Everything below it will be ignored.
diff --git a/src/auth.py b/src/auth.py
index 83db48f..d substring 100644
--- a/src/auth.py
+++ b/src/auth.py
@@ -1,5 +1,6 @@
import os
...
# <subject> (max 50 chars)
# |<---- 50 chars ---->|
#
# <body> (wrap at 72 chars, explain what and why, not how)
# |<---- 72 chars ---->|
#
# Issue: #<number>
# Signed-off-by: <your name>