Writing commit messages
- Read the staged diff (
git diff --cached) and the recent subjects (git log --oneline -10) before you write. - A caller can fix the subject, the type, or a body line, such as a plan citation. Use each fixed part byte for byte, even when it breaks a rule below, and apply the rules only to the parts you write.
- Write the message per commit messages, and the prose per the writing standards.
- When asked to commit, write the message to a file with the file-writing
tool, then run
git commit -F <message-file>, never a baregit commit. Never rungit add -porgit add -i: they open a prompt. - Report the full message.