About that bang!

Thanks for this. I’d not used/encountered the bash ! reserved word before. My reading came up with explanations like this:

Reserved word. Logical NOT of a command exit status.

This confuses me. Doesn’t this mean if the command succeeds it will exit with an error status? I’m clearly misunderstanding the explanation. Can you expand on the minimal descriptions I found?


From Git - Book

Git simply replaces the new command with whatever you alias it for. However, maybe you want to run an external command, rather than a Git subcommand. In that case, you start the command with a ! character.

The value with ! is not being interpreted in Bash, it’s a single-quoted value being passed as a single raw token to the git config command.

1 Like

Ah, okay. Thanks…