Interview Prep/Git & GitHub/Submodules, LFS and Hooks

The `commit-msg` hook rejected your long, carefully written commit message, and you don't want to retype it.

BeginnerTroubleshootingSubmodules, LFS and Hooks
Answer

Likely causes → The message failed a convention check (Conventional Commits, ticket ID). The message you typed is saved in .git/COMMIT_EDITMSG.

Diagnose → cat .git/COMMIT_EDITMSG

Fix → Edit it and reuse it:

vim .git/COMMIT_EDITMSG          # fix the subject, e.g. "feat(api): add retry"
git commit -F .git/COMMIT_EDITMSG
# or open it in the editor: git commit -e -F .git/COMMIT_EDITMSG

Prevent → Use a commit template (git config commit.template .gitmessage) that reminds you of the format.

All Git & GitHub questions Roadmap: Git & GitHub

More on Submodules, LFS and Hooks