I was really happy I fixed this stupid bug in my Ruby on Rails code, and I happily typed the following into the terminal:
git add .
git commit -am "Finally fixed that difficult bug!"
Only to find out that Git doesn't like "!". Is there a way I can get it into my commit message?
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.
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.