Git中的特殊字符可能吗? [英] Special Character in Git possible?

查看:98
本文介绍了Git中的特殊字符可能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的很高兴在我的rails代码中修复了这个愚蠢的错误,并愉快地在终端中输入了以下内容:

I was really happy I fixed this stupid bug in my rails code and I happily typed the following into terminal:

git add .
git commit -am "Finally fixed that difficult bug!"

仅发现git不喜欢!".有人知道我可以将其纳入提交消息的方法吗?

Only to find out that git doesn't like "!". Does anyone know of a way I can get it into my commit message?

推荐答案

使用单引号.我不知道为什么双引号不起作用.实际上,这是您的shell而不是git的问题,在bash中,它与命令历史记录有关.

Use single quotes. I don't know why it doesn't work in double quotes. It's actually a problem with your shell rather than git, in bash it has to do with command history.

您还可以省略"m"选项,并在编辑器中输入提交消息.这样一来,您就不必担心转义.

You can also leave out the 'm' option and enter your commit message in your editor. That way you don't ever have to worry about escaping.

这篇关于Git中的特殊字符可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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