Commit-editmsg __full__ May 2026
When you execute git commit , Git performs several background tasks: It creates the COMMIT_EDITMSG file.
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! . 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). When you execute git commit , Git performs
If you close the COMMIT_EDITMSG file without adding any text (or if you delete the existing text), Git will abort the commit, assuming you changed your mind [5.5]. When you execute git commit