I used the prepare-commit-msg hook to solve this.
First create a file .git/commit-msg
with the template of the commit message like
$ cat .git/commit-msg
My Commit Template
Next create a file .git/hooks/prepare-commit-msg
with the contents
#!/bin/sh
firstLine=$(head -n1 $1)
if [ -z "$firstLine" ] ;then
commitTemplate=$(cat `git rev-parse --git-dir`/commit-msg)
echo -e "$commitTemplate\n $(cat $1)" > $1
fi
Mark the newly-created file as executable:
chmod +x .git/hooks/prepare-commit-msg
This sets the commit message to the contents of the template.