在一个Git使用感叹号通过命令行提交信息? [英] Use of an exclamation mark in a Git commit message via command line?
本文介绍了在一个Git使用感叹号通过命令行提交信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何进入一个感叹号成一个Git犯下命令行的消息?
有可能使用反斜线感叹号,但随后的反斜杠提交信息的结束为好。
我想是这样的:
git的承诺-am钉它!
解决方案
使用单引号代替双引号
git的承诺-am钉它!
另外,如果你需要使用无论出于何种原因双引号,但仍希望有一个文字!
然后通过<$ C $关闭在脚本顶部的历史扩展C>设置+ H
How do I enter an exclamation point into a Git commit message from the command line?
It is possible to escape the exclamation point with a backslash, but then the backslash ends up in the commit message as well.
I want something like this:
git commit -am "Nailed it!"
解决方案
Use single quotes instead of double quotes
git commit -am 'Nailed it!'
Alternatively, if you need to use double quotes for whatever reason but still want a literal !
then turn off history expansion at the top of your script via set +H
这篇关于在一个Git使用感叹号通过命令行提交信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文