How do/should I format my code in a Git commit message?

Calin Baenen - Jul 21 '22 - - Dev Community

So, I was trying to make a Git commit for a game I am working on so I could track my progress, and I wanted to include some formatted code.
Particularly, I wanted them to look like ðis kind of codeblock.

However, in the command line when I tried typing out my message

[calin@CalinArchPC RuntDeale]$ git commit -m "Merged `Level`, `LOVE`, and `XP` components into the `Player` component.
Changed the type of LOVE (Level Of ViolencE) from `i32` to `u32`.
Merged the `Layer` into the `Point` component.
Renamed the `Point` component to `Location` to accommodate the new field."
Enter fullscreen mode Exit fullscreen mode

when I tried this I got a lot of unexpected errors.
I looked up the issue and immediately found out what was wrong, so instead I wanted to try it from a text editor, one Google search later and I ended up with git commit --amend.

So, this opened a file in VSCode, this made me happy, I thought this meant I was getting somewhere.
But nope, even after inserting the backticks via file it still didn't work.
So I looked up how I could possibly escape the character, which led me to this ServerFault post.
It says you can escape it with three (3) backslashes, so I tried doing a little test by inserting:

\\\`test\\\`
Enter fullscreen mode Exit fullscreen mode

into my Git message.
The result... Nope. Didn't work.

So, how do I format code in Git?
For now I'll just write it without the backticks, it won't be too huge of a deal for now, but I'd like to know how I can format code for a future reader's reference.

Thanks for reading!
Cheers!

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .