I try to use Conventional Commitsexternal link in my public Git repositories. I wasn’t used to the Angular style, so it felt a bit weird at the beginning. The best part is that I don’t have to think about the scope of changes when I push. They’re automatically translated by a GitHub Actionexternal link into Semantic Versionsexternal link . I really like SemVer, as it makes it easy to see how difficult an upgrade might be, but it’s harder from a developer’s perspective to remember what constitutes a major, minor, or patch change.

I don’t introduce breaking changes very often, so I was surprised when I tried this:

ZSH error I was getting
$ git commit -am "chore!: drop Java 11 support"
zsh: illegal modifier:

What the heck?

That’s how I learned what ! does in ZSH: it’s used for history expansion. For example:

  • !! - repeats the last command.
  • !ls - repeats the last command that starts with ls.
  • !123 - repeats the 123rd command from your history.

It works also in quoted strings! This articleexternal link explains it deeper.

The thing is, I’m a heavy user of Ctrl+R. On bash, it was quite primitive, but with zsh and fzf, it’s amazingexternal link . I would never exchange that for the “bang” syntax, so I found a way to disable it:

Disable history expansion
echo "setopt NO_BANG_HIST" >> ~/.zshrc

This adds to my already lengthy Zsh history config . Now, let’s reload zsh:

Reload ZSH
source ~/.zshrc

And it’s gone. I can use “bangs” in quotes as much as I want.


Enjoyed this post? Buy Me a Coffee at ko-fi.com