G.Thompson
G.Thompson

Reputation: 827

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.

Upvotes: 1

Views: 769

Answers (1)

sleske
sleske

Reputation: 83635

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".

Upvotes: 6

Related Questions