Commit-editmsg Portable May 2026
You can actually influence what appears in COMMIT_EDITMSG before you even start typing.
A detailed explanation of the why behind the change, wrapped at 72 characters. COMMIT-EDITMSG
COMMIT_EDITMSG is a temporary file located in the .git directory of your repository. Its primary purpose is to hold the text of your commit message while you are drafting it in an external editor (like Vim, Nano, or VS Code). You can actually influence what appears in COMMIT_EDITMSG
It populates it with a template or existing comments (lines starting with # ). It opens your configured core editor . Its primary purpose is to hold the text
For many beginners, the first encounter with COMMIT_EDITMSG is an accidental trip into Vim. To save your message and exit, type :wq . To abort, type :q! .
Understanding .git/COMMIT_EDITMSG : The Heart of Meaningful History