无法添加“!”符号在我的git commit消息中 [英] Can't add the "!" symbol in my git commit message

查看:109
本文介绍了无法添加“!”符号在我的git commit消息中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能存在重复:

如何从命令行输入一个感叹号到git commit消息中? p>

我是git的新手,并且执行了此命令:

  git commit -m第一次提交! 

这会引发如下错误:

  bash:!:未找到事件

为什么会这样错误发生了吗?是在Git中,我不应该在 commit

中使用符号b
$ b

是否有其他符号不应使用或应该用任何转义序列进行转义?

与git无关,与bash有更多关系 - 逃避或使用单引号,即

  $ git commit -mFirst Commit \!



<

  $ git commit -m'第一次提交!'


Possible Duplicate:
How do I enter an exclamation point into a git commit message from the command line?

I'm new to git, and I did this command:

git commit -m "First Commit!"

This throws an error like this:

bash: !": event not found

Why is this error happening? Is is that in Git, I shouldn't use ! symbols in commit?

Are there other symbols which I shouldn't use or should escape with any escape sequence?

解决方案

Nothing to do with git, more to do with bash - escape the ! or use single quotes, i.e.

$ git commit -m "First Commit\!"

or, better:

$ git commit -m 'First Commit!'

这篇关于无法添加“!”符号在我的git commit消息中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆