本文介绍了通过命令行在Git提交消息中使用撇号(单引号)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用此又一步。
I am trying to take this one step further. How could this work in a standard Bash shell?
git commit -m 'cracked enigma's code'是否可以像下面这样简单地通过反斜杠转义呢?
Could this simply be done with backslash-escaping like the following?
git commit -m 'cracked enigma\'s code'进一步,如何使用双引号?还通过反斜杠转义吗?那是最好的方法吗?有什么好的替代方法吗?
Further, how could double-quotes be used? Also by backslash-escaping? Would that be the best way? Are there any good alternative ways?
git commit -m 'cracked the "real" enigma's code'推荐答案
使用双引号:
git commit -m "cracked enigma's code",如果您的邮件中包含其他特殊字符,则仅对单引号使用双引号或反斜杠:
Or, if your message contains other special characters, use double quotes or backslash only for the single quote:
git commit -m 'cracked $enigma'"'"'s code' git commit -m 'cracked $enigma'\''s code'更多推荐
通过命令行在Git提交消息中使用撇号(单引号)
发布评论