COMMIT-EDITMSG is a temporary file used by Git to store your commit message while you are writing it in an editor. This file is located at .git/COMMIT_EDITMSG within your project's root directory. 🛠️ How it Works When you run git commit without the
Stop rewriting messages from scratch. Let Git remember them for you. 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
...
commit.templateYou can specify a file path as a template. COMMIT-EDITMSG is a temporary file used by Git
: Once you save and close the file, Git reads its contents, ignores any lines starting with commit
How to write good commit message for multiple changes? : r/git
If you want a shorter or more formal commit message tailored to a specific project style (e.g., Conventional Commits), say which convention and I’ll adapt it.
Standardization: To maintain professional history, many teams follow the 50/72 rule within this file: a 50-character summary line, followed by a blank line and a 72-character wrapped body. Troubleshooting: The "Swap File" Error