Can't add the “!” symbol in my git commit message

Possible Duplicate:
How do I enter an exclamation point into a git commit message from the command line?

I’m new to git, and I did this command:

  • How do you deal with non-fast-forwardable situations in the git rebase workflow?
  • Advice on multiple release lines and git-flow, for git non-gurus
  • Can you change a file content during git commit?
  • Automatically deploying assets to Rackspace CDN via git and updating references to those assets?
  • How to handle multiple db alter scripts coming from different Git feature branches?
  • error: pathspec 'test-branch' did not match any file(s) known to git
  • git commit -m "First Commit!"

    This throws an error like this:

    bash: !": event not found

    Why is this error happening? Is is that in Git, I shouldn’t use ! symbols in commit?

    Are there other symbols which I shouldn’t use or should escape with any escape sequence?

  • Why won’t git further reduce the repository size?
  • Git Merge and Missing changes
  • GIT: how to revert back only one historical change while keep others as they are?
  • What is the correct way with NPM to package a BUILT version of a forked Git repository?
  • Is cross-branch reference possible?
  • My Android Project has are now Colored Red after Experimenting with CVS in android studio
  • 3 Solutions collect form web for “Can't add the “!” symbol in my git commit message”

    Nothing to do with git, more to do with bash – escape the ! or use single quotes, i.e.

    $ git commit -m "First Commit\!"


    $ git commit -m 'First Commit!'

    That’s not git related at all, but bash related. Using ! in a string will cause bash to attempt history expansion. If you don’t want that, either use single-quoted strings or escape the exclamation mark with a backslash.

    No, this is possible in with the git command line and double quotes. One easy fix is putting a space after !.

    git commit -m "First Commit! "

    Another way to get around this is by using git gui or just git commit and then specifying the message in the editor that opens.

    The limitation is clearly a bash limitation and not a problem of git. You can avoid it using single quotes:

    git commit -m 'First Commit!'
    Git Baby is a git and github fan, let's start git clone.