1

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.

G.Thompson
  • 807
  • 2
  • 11
  • 25
  • Possible duplicate of [Use of an exclamation mark in a Git commit message via command line?](http://stackoverflow.com/questions/5131948/use-of-an-exclamation-mark-in-a-git-commit-message-via-command-line) – Jannie Theunissen Feb 16 '17 at 10:57

1 Answers1

6

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

sleske
  • 81,358
  • 34
  • 189
  • 227
  • Thanks so much! is there any way I can change/delete this message incase it happens again? I know it seems minor but I shared my bash profile with a few people and I know they'll probably get it as well. – G.Thompson Jun 25 '13 at 16:23
  • @GThompson: I'm not sure where this message comes from, but if it's from your Bash history, it should be in ~/.bash_history. Try to look there. – sleske Jun 26 '13 at 10:40