简体   繁体   中英

Weird message on .git commit with exclamation point

So here's a REALLY odd one that i've never seen before. When ever I commit with an un-escaped exclamation point I get a really odd message...

git commit -am "New stuff!"

the result is something like...

git commit -am "New stuff"why dont you go back to Philadelphia?"
> 

I have a custom bash profile but I can't figure out why it's giving me this damn message and how I can find it and change/delete it.

The exclamation mark ! has a special meaning to bash - it triggers history substitution.

To use the exclamation mark in a commit message, escape it using \\ :

git commit -am "New stuff\!"

or use single quotation marks (which prevent most kinds of substitution):

git commit -am 'New stuff!'

See the Bash Reference Manual, chapter "9.3.1 Event Designators" .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM