Commit-editmsg -
: If you abort a commit (e.g., by exiting your editor with an empty message), Git deletes the file. Do not manually edit COMMIT_EDITMSG while a commit is not in progress. Always let Git create and manage the file.
COMMIT_EDITMSG is Git's transient, editor-friendly buffer for composing a commit message. It is not a permanent record, not tracked by version control, and is overwritten on each new commit. Understanding it helps you write better commit messages, recover from failed commits, and write custom hooks to enforce team standards. COMMIT-EDITMSG