Using exclamation marks in commit messages!

Adam K Dean - Jan 27 '14 - - Dev Community

If you've ever been particularly excited by a recent packet of work you've done, and tried to show your excitement by putting an exclamation mark into the commit message, then you may have been met with this particular error:

git commit -m "I did some most excellent work!"
sh.exe": !": event not found
Enter fullscreen mode Exit fullscreen mode

You have two ways around this. One most excellent way is to use single quotes:

git commit -m 'I did some most excellent work!'
[branch 123abc] I did some most excellent work!
1 file changed, 2 insertions(+)
Enter fullscreen mode Exit fullscreen mode

Another way, if you require double quotes, is to add it onto the end with single quotes:

git commit -m "I did some most excellent work"'!'
[branch 123abc] I did some most excellent work!
1 file changed, 2 insertions(+)
Enter fullscreen mode Exit fullscreen mode

Unfortunately, simply escaping the character will not work, you will just end up with \!.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player