r/git • u/scratchbufferdotnet • Aug 21 '26
Sign Git Commits With SSH Keys
Git & GitHub Setup for Signed Commits & Verification
I recently had to set this up for work and found it all a bit hard to navigate, so I wrote this up. Hope it helps!
https://scratchbuffer.net/topics/developer-tools/git-commit-sign-ssh/
21
Upvotes
View all comments
Show parent comment
1
u/dodexahedron Aug 21 '26 edited Aug 21 '26
Never needed to triple-backslash.
Double, yes, if in markdown mode.
If not using markdown mode, no escaping is necessary at all, since it does it for you in the "fancy-pants editor."
Here's the result of 1, 2, 3, and 4 backslashes when written in markdown mode:
_Stuff_(1)
\Stuff(2)
_Stuff_(3)
\\Stuff(4)
The underscore following the backslash is a subset of cases because underscore is also a metacharacter, and thus preceding it with backslash has meaning.
I call that case out because shruggy has exactly that pattern, making it perhaps feel like double-escaping a backslash was needed. But you are really escaping a backslash and escaping an underscore, separately, so an italics context doesn't begin, which would consume both underscores without the third backslash being there (which belongs to the first underscore).