I use backtick character in my commits very often. I also usually commit using git commit -m
When I run a command like this
git commit -m "add `foo`"
Bash tries to execute foo
.
I can use backslash \
to escape the backtick but I am wishing for a better solution to avoid escaping backtick all the time.
Use single quotes instead of double quotes.
git commit -m 'add `foo`'
Variables, backticks, and $(...)
are expanded in double quotes, but not single quotes.
See Difference between single and double quotes in Bash
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With