Write a Markdown heading or start a line with an issue number like #142 in the editor, and the line vanishes from the commit. By default, much to my annoyance, Git treats every line beginning with # as a comment and strips it.
The scissors mode changes how it decides what to throw away:
git config --global commit.cleanup scissors
From then on the editor shows a marker line like this one:
# ------------------------ >8 ------------------------
Everything below the marker is removed, including the status hints and, with verbose mode, the diff. Everything above it stays, hash lines included. So this message survives as written:
Update the setup notes
#142 asked for a clearer install section.
To try it once before changing your config, pass it for a single commit:
git commit --cleanup=scissors
Two catches. The scissors rule only applies when you edit the message in an editor. With -m, Git keeps your text and only trims whitespace. And don’t delete the marker line while editing: without it, the hint lines Git added below can end up in your history. Run git log -1 after the first commit to see that it came out the way you expected.
Further reading: git-commit documentation, git-config documentation